Roedy Green wrote:
> I was enshrining a heavily commented variant of your code as an
> example at http://mindprod.com/jgloss/xsd.html
That has
// get the custom xsd schema describing the required format for my XML
files.
Schema schemaXSD = schemaFactory.newSchema( new File ( "myschema.xsd" ) );
// hook up org.xml.sax.ErrorHandler implementation.
schemaFactory.setErrorHandler( myErrorHandler );
but you should set up the error handler first on the schema factory and
then call newSchema e.g.
// hook up org.xml.sax.ErrorHandler implementation.
schemaFactory.setErrorHandler( myErrorHandler );
// get the custom xsd schema describing the required format for my XML
files.
Schema schemaXSD = schemaFactory.newSchema( new File ( "myschema.xsd" ) );
if the aim is to have the error handler report any problems found while
parsing and compiling myschema.xsd.
--
Martin Honnen
http://JavaScript.FAQTs.com/