#778 ValidatorHandler with no ContentHandler

v9.0
closed
Michael Kay
5
2012-10-08
2008-02-13
Michael Kay
No

If a JAXP ValidatorHandler is created to validate an instance document against a schema, a ContentHandler can be supplied to receive the validated document complete with type annotations, defaulted attributes, and so on. However, the ValidatorHandler is supposed to run even if no ContentHandler is supplied. In this situation the Saxon implementation of ValidatorHandler crashes with this stack trace:

Running it produces this stack trace:

Exception in thread "main" java.lang.IllegalStateException:
ContentHandlerProxy.open(): no underlying handler provided
at net.sf.saxon.event.ContentHandlerProxy.open(ContentHandlerProxy.java:254)
at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:80)
at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:80)
at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:80)
at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:80)
at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:80)
at net.sf.saxon.event.ProxyReceiver.open(ProxyReceiver.java:80)
at net.sf.saxon.event.ReceivingContentHandler.startDocument(ReceivingContentHandler.java:202)

A patch has been produced; the problem will be fixed in the next maintenance release. Meanwhile, please supply a ContentHandler (this can simply be an instance of org.xml.sax.helpers.XMLFilterImpl)

Discussion

  • Michael Kay
    Michael Kay
    2008-03-17

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.4