Hi DeWayne,

Dantzler, DeWayne C <[email protected]> writes:

> I thought that calling the methods loadGrammar and
> usedCachedGrammarInParse would force the parser to use the grammar just
> loaded instead of loading the grammar specified by the instance
> document. I tried the following below and it appears that the parser
> attempted to use the DTD specified in the XML file rather than the one I
> loaded and cached.

Unlike XML Schema which has a target namespace as a grammar identifier,
for DTD there is no way for the parser to know that the grammar in cache
is the same as the one referenced from XML instance. So, in your case,
the parser will use both grammars. One way to change this might be to
do setLoadExternalDTD(false).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

Reply via email to