Re: Differences between Xerces and xmllint when resolving nested XIncludes

Michael Glavassevich <[email protected]>
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <OF170364F7.A1ED8B5F-ON85257BF6.005D2CE4-85257BF6.005D3F93@ca.ibm.com>
Hi Jan,

Looks like you've hit XERCESJ-1102 [1]. This is a long standing defect in 
the XInclude support. There's a patch attached to the JIRA issue that you 
might want to try though it hasn't been evaluated yet.

Thanks.

[1] https://issues.apache.org/jira/browse/XERCESJ-1102

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

"Jan Tosovsky" <[email protected]> wrote on 09/26/2013 12:24:24 
PM:

> Dear All,
> 
> I have modular document with nested XIncludes and relative URIs to 
images
> stored in different folders.
> 
> When it is parsed and stored into a single file using Xerces-J 2.11, 
these
> URIs in nested files are processed incorrectly and point to the wrong
> location.
> 
> Parsing it with the xmllint tool produces all the outputs correctly.
> 
> Both source files and final results are available at
> http://drifted.in/other/xincludes.zip
> 
> The difference is an invalid xml:base in that nested case:
> 
> Xerces : xml:base="Common/Examples/XInclude/Image.xml"
> xmllint: xml:base="XInclude/Image.xml"
> 
> For parsing I use something like this:
> 
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> factory.setNamespaceAware(true);
> factory.setXIncludeAware(true);
> DocumentBuilder parser = factory.newDocumentBuilder();
> parser.setEntityResolver(new CatalogResolver());
> Document document = parser.parse(xmlFile);
> 
> Is there available any feature which I should switch on? 
> Is there any workaround?
> 
> Using xmllint in the Java ecosystem is problematic.
> 
> Thanks, Jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.