[xsd-users] External entity declaration in instance documents

Boris Kolpackov boris at codesynthesis.com
Mon Oct 4 09:16:18 EDT 2010


Hi Florian,

Florian Schmidt <fschmidt at techfak.uni-bielefeld.de> writes:

> > I think i found the culprit.. Linking against libxqilla and creating an
> > instance of XQilla (from the QXilla simple API) triggers the parsing
> > failure on my system.. When i find time i might browse through some
> > XQilla code to see what the constructor of the XQilla class does..
> 
> I'm at a loss here about how i could workaround that. I attached the
> test case you sent me a while ago modified to expose the problem. The
> only alteration is to link against libxqilla and creating an instance of
> XQilla in the main() function of the driver.cxx

I finally got around to looking into this. What happens is the following:
XQilla registers its own DOM implementation which returns parsers configured
with grammar caching enabled. Ideally, this should only happen when the user
of the DOM API ask for a DOM implementation with XPath support ("XPath2 3.0"
feature string). When the user requests the Load-Store implementation ("LS"
feature string), then the standard Xerces-C++ implementation should be
used. However, this is not how it works at the moment and XQilla returns
its implementation for all feature strings. To fix this both Xerces-C++
and XQilla will have to be changed.

The relatively easy workaround for this problem would be to do the XML to
DOM parsing yourself and use XercesDOMParser class instead of the standard
DOMLSParser interface. This way you will get the default parser behavior
without any caching. Or, you can use DOMLSParser (see the 'multiroot'
example) and turn off the grammar caching (fgXercesCacheGrammarFromParse)
before parsing the document.

Boris



More information about the xsd-users mailing list