Java sax parser validating

by  |  07-Feb-2020 11:32

The Input Source object is created with an Input Stream object created from the example XML schema document, As discussed before, we have used an Input Source object because most SAX implementations are Input Source based.

You've written your own Validator Handler which doesn't do anything at all. the one in Xerces or the one in Saxon) which does real validation against a schema. I thought it should be an argument for new Validator Handler(), but this seems not to be possible.

Schema Factory schema Factory = Schema Factory Instance(XMLConstants.

Your Content Handler will be notified of default values for optional attributes. Unfortunately, I'm still having problems with my implementation, since my parser does not accept my validator as content handler.

If it uses some custom mechanism, you may have to do a "prepass" reading (some of) the source file to discover the schema, then reading it again with the Validator Handler in place.

I'm using a SAX parser with a custom handler to parse some XML files.

Community Discussion