On 3/15/2010 7:42 AM, Barry Walker wrote:
Xerces Question,
I'm setting up a validating parser using the Sax2 interface. I chose =
this interface because of the size of my xml files (thousands of lines), =
and I'm creating my own DOM like object. The callback interface makes =
this easy..
My problem is with the validation. My schema validation works =
perfectly but the syntax or well-formedness validation doesn't seem to =
be working.. I ran my same xml document though Expat xml parser and it =
catches the syntax errors.. Am I missing some feature or a property =
need to enable syntax checking when using Sax2?
This is usually done with a custom ErrorHandler instance. You might want
to look at the Sax2Count or Sax2Print samples for more information.
You say schema validation works, but the parser reports well-formedness
errors through the same mechanism, so I don't know how the parser would
report only validation errors.
According to the docs that I seen so far the default scanner =
(IGXMLScanner) should do syntax checking automatically. I even tried to =
explicitly choose that scanner..
Maybe a build option?? I'm developing in a Linux environment.
There are no options you need to enable, because the XML recommendation
requires parsers to report well-formedness errors.
Dave