Thankyou for all the replies.

I have written a test application to set these features. Basically cut up
the DOMCount sample.

I have the following code:

try
{
        DOMParserWrapper parser =
(DOMParserWrapper)Class.forName(parserWrapperName).newInstance();

arser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion";,
setDeferredDOM );
        parser.setFeature( "http://xml.org/sax/features/validation";,
setValidation );
        parser.setFeature( "http://xml.org/sax/features/namespaces";,
setNameSpaces );
        parser.setFeature( "http://apache.org/xml/features/validation/schema";,
setSchemaSupport );

        Document document = parser.parse(uri);
}
catch (org.w3c.dom.DOMException ex)
{
}
catch (org.xml.sax.SAXParseException spe)
{
}
catch (org.xml.sax.SAXNotRecognizedException ex )
{
}
catch (org.xml.sax.SAXNotSupportedException ex )
{
}
catch (org.xml.sax.SAXException se)
{       
        if (se.getException() != null)
        se.getException().printStackTrace(System.err);
      else
        se.printStackTrace(System.err);
} 
catch (Exception e) 
{
        e.printStackTrace(System.err);
}

I can't seem to trap the error output. I am getting an error output if the XML 
does not conform the schema which is correct, but it is dumping it to the 
screen, rather than me being able to trap it. What other possible catch() 
exceptions are there that I can trap? In C++ I simply write a general catch 
routine at the end : catch(...) { }. Can I do something like that?

Also, each time I want to compile and run this program, I need to remove the 
<xerces-install-path>/bin and <xerces-install-path>/class directories, so I can 
run "gmake jars" again and build in my updated program to the dom package. I'm 
sure there is a better way than this.

Thanks,
Sam



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to