XML parser Xinclude support for XML schema's Id

Oxygen general issues.
colibrisson
Posts: 5
Joined: Mon Apr 10, 2017 6:44 pm

XML parser Xinclude support for XML schema's Id

Post by colibrisson »

Hello,

I'm using <oXygen/> XML Editor 18.1.

I have some issues referencing part of an XML file by its Id using the XInclude element() scheme. I read somewhere that it's because Xerces doesn't support XML Schema Id. Is there another XML parser that offers a better support for XInclude?

Thanks in advance,

Colin
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: XML parser Xinclude support for XML schema's Id

Post by Radu »

Hi Colin,

If in the referenced document you have a Docbook section with an xml:id like this:

Code: Select all


.......
<sect1 xmlns="http://docbook.org/ns/docbook" version="5.0"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sid">
...........
then the xpointer would need to look like this:

Code: Select all

<xi:include href="section1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="sid"/>
So to refer an element by ID, you just place the ID value in the xpointer attribute.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
colibrisson
Posts: 5
Joined: Mon Apr 10, 2017 6:44 pm

Re: XML parser Xinclude support for XML schema's Id

Post by colibrisson »

Hi Radu,

The problem is that Xerces' XInclude processor - or maybe more accurately Xerces's XPointer processor - doesn't seem to recognize the Id attributes or elements declared in XML Schema. I have tried to use XPointer's element() scheme in order reference Id with xs:ID and xs:anyUri types but none of them were recognized while the child sequence is working find. Is there another parser using a processor supporting XML Schema Id type?
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: XML parser Xinclude support for XML schema's Id

Post by Radu »

Hi,

Maybe you could google and see if you can find other implementations of XInclude XPointer, I do not know of any but they might and probably exist.
In my opinion, even if they are they probably do not parse the XML Schema associated with the XML to detect the types of each attribute.
Even if they exist, they cannot be tightly coupled with Oxygen so even if you create a command line to validate and publish your XML, Oxygen will still show errors when validation the file.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
colibrisson
Posts: 5
Joined: Mon Apr 10, 2017 6:44 pm

Re: XML parser Xinclude support for XML schema's Id

Post by colibrisson »

Thank you !
Post Reply