That error has nothing to do with validation. If an XML document has a
DOCTYPE, the parser will _always_ attempt to process the DTD. This is
standard behavior, since the DTD may contain declarations that affect the
content of the document, irrespective of validation. This question has
been asked many times, and I'm surprised you did not find anything in the
archives. I don't believe the standalone document declaration is supposed
to force the parser to ignore the external subset.
The easiest solution is to create a custom EntityResolver which returns an
InputSource for a dummy DTD. You can then install that EntityResolver in
the XalanSourceTreeParserLiaison instance.
By the way, any class name that begins with Xalan is part of Xalan and not
Xerces. It's best to ask Xalan questions on the Xalan list, not on the
Xerces list.
Dave
Harry Chan
<hchan@liquidnet To:
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
.com> cc: (bcc: David N
Bertoni/Cambridge/IBM)
Subject: Ignoring DOCTYPE Declaration
03/14/2002 10:36
AM
Please respond
to xerces-c-dev
Hi,
Can anyone tell me how to tell XalanSourceTreeParserLiaison to ignore the
DOCTYPE declaration, i.e., not to validate.
I tried setting validition to false through useValidation(), which from my
understanding defaults to false anyways.
I still get the following exception:
An exception occured! TYPE:RuntimeException, Message:Could not open DTD
file
I even manually inserted standalone="yes" in the XML declaration and the
parse still tries to find the DTD file.
I tried searching the archives but was unable to locate anything.
Thanks to all,
Harry.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]