XML parser Xinclude support for XML schema's Id

<oXygen/> general issues.
colibrisson
Posts: 5

XML parser Xinclude support for XML schema's Id

Thu Apr 13, 2017 12:15 pm

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: 5226

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

Thu Apr 13, 2017 1:30 pm

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

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

Thu Apr 13, 2017 2:56 pm

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: 5226

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

Thu Apr 13, 2017 3:02 pm

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 3 guests