[EMAIL PROTECTED] wrote:
Hi,
Even when XML validation is turned-off, through
XalanTransformer.setUseValidaton( false ); I find that the parser is
attempting to load DTD/schema when source document is parsed. How can I
tell the parser not to load external DTD or Schema? There is a method
setLoadExternalDTD( bool ) defined for AbstractDOMParser class, would
calling this method help? If yes, how can I invoke this method on the
parser through XalanTransformer class object?
The parser always reads the DTD because there may be entity definitions (or
default attribute definitions, etc,) which have nothing to do with
validation, but may be necessary to parse the document. You should be
absolutely certain that not reading the DTD will not affect the document
before you attempt to "skip" it.
The typical way to skip the DTD is to install an EntityResolver instance
which returns an empty InputSource instance in the
InputSource::resolveEntity() call. You should look at the Xerces-C
documentation for more information about implementing this class. Once
you've implemented it, you can call XalanTransformer::setEntityResolver()
to make it available to the XalanTransformer instance.
Dave