You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jan Tosovsky <ja...@gmail.com> on 2013/09/26 18:24:24 UTC

Differences between Xerces and xmllint when resolving nested XIncludes

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: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: C++ XMLCatalogResolver

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
The XML Commons resolver is a Java only component. You might want to ask 
on the c-users list or another forum for C++ alternatives.

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Rick Brown <ta...@swbell.net> wrote on 09/26/2013 06:44:54 PM:

> Does anyone have a C++ XMLCatalogResolver that they are willing to 
> share  the source to?
> 
> Or know where I can find one?
> 
> Rick Brown
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


C++ XMLCatalogResolver

Posted by Rick Brown <ta...@swbell.net>.
Does anyone have a C++ XMLCatalogResolver that they are willing to 
share  the source to?

Or know where I can find one?

Rick Brown

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


RE: Differences between Xerces and xmllint when resolving nested XIncludes

Posted by Jan Tosovsky <ja...@gmail.com>.
On 2013-09-30 Jan Tosovsky wrote:
> On 2013-09-30 Michael Glavassevich wrote:
> > "Jan Tosovsky" <ja...@gmail.com> wrote on 09/30/2013
> > > On 2013-09-30 Michael Glavassevich wrote:
> > > >
> > > > 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
> > > >
> > > > [1] https://issues.apache.org/jira/browse/XERCESJ-1102
> > > >
> > >
> > > Exactly! With that patch the xml:base is processed correctly.
> > > Thanks a lot for the link!
> > >
> >
> > I've added it to my TODO list. Need to verify that it works in
> > general.

Are there any plans to review that patch?

Thanks, Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


RE: Differences between Xerces and xmllint when resolving nested XIncludes

Posted by Jan Tosovsky <ja...@gmail.com>.
On 2013-09-30 Michael Glavassevich wrote:
> "Jan Tosovsky" <ja...@gmail.com> wrote on 09/30/2013 01:57:44
> > On 2013-09-30 Michael Glavassevich wrote:
> > >
> > > 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.
> > >
> > > [1] https://issues.apache.org/jira/browse/XERCESJ-1102
> > >
> >
> > Exactly! With that patch the xml:base is processed correctly. Thanks
> > a lot for the link!
> >
> 
> I've added it to my TODO list. Need to verify that it works in general.

Great! Thanks.
 
> > Is there any roadmap for upcoming releases?
> 
> No plans have been discussed for future releases.

Ok. 

Regards, Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


RE: Differences between Xerces and xmllint when resolving nested XIncludes

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
"Jan Tosovsky" <ja...@gmail.com> wrote on 09/30/2013 01:57:44 
PM:

> From: "Jan Tosovsky" <ja...@gmail.com>
> To: <j-...@xerces.apache.org>, 
> Date: 09/30/2013 01:58 PM
> Subject: RE: Differences between Xerces and xmllint when resolving 
> nested XIncludes
> 
> On 2013-09-30 Michael Glavassevich wrote:
> >
> > 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.
> > 
> > [1] https://issues.apache.org/jira/browse/XERCESJ-1102
> > 
> 
> Exactly! With that patch the xml:base is processed correctly. Thanks a 
lot
> for the link!
> 
> Would it be possible to apply that single line patch into the trunk? How 
can
> I help with it?

I've added it to my TODO list. Need to verify that it works in general.

> Without this fix the following statement from the project Home page is 
IMHO
> incorrect:
> Xerces2 ... provides a complete implementation of the XML Inclusions
> (XInclude) W3C Recommendation.
>
> Is there any roadmap for upcoming releases?

No plans have been discussed for future releases.

> Thanks, Jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


RE: Differences between Xerces and xmllint when resolving nested XIncludes

Posted by Jan Tosovsky <ja...@gmail.com>.
On 2013-09-30 Michael Glavassevich wrote:
>
> 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.
> 
> [1] https://issues.apache.org/jira/browse/XERCESJ-1102
> 

Exactly! With that patch the xml:base is processed correctly. Thanks a lot
for the link!

Would it be possible to apply that single line patch into the trunk? How can
I help with it?

Without this fix the following statement from the project Home page is IMHO
incorrect:
Xerces2 ... provides a complete implementation of the XML Inclusions
(XInclude) W3C Recommendation. 

Is there any roadmap for upcoming releases?

Thanks, Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: Differences between Xerces and xmllint when resolving nested XIncludes

Posted by Michael Glavassevich <mr...@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: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Jan Tosovsky" <ja...@gmail.com> 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: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org