[xml] XInclude and XPointer/range-to query



Title: XInclude and XPointer/range-to query

Folks,

I'm having a problem using XPointer based XInclude instructions and am not sure whether its down to incorrect assumptions or simple lack of knowledge on my part.

Consider:

---base.xml---
<sect1>
  <title>Test</title>
  <para>First Paragraph</para>
  <para>Second Paragraph</para>
  <para>Third Paragraph</para>
</sect1>
---base.xml---

---include.xml---
<sect1>
  <title>XInclude Test</title>
  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
              href="">
              xpointer="xpointer(/sect1/para[1]/range-to(/sect1/para[2]))"/>
</sect1>
---include.xml---

What I'm trying to do with the above is include the first and second paragraphs (and everything inbetween, should there be anything) from base.xml in include.xml.

---expected---
<?xml version="1.0"?>
<sect1>
  <title>XInclude Test</title>
  <para>First Paragraph</para>
  <para>Second Paragraph</para>
</sect1>
---expected---

Now, doing an `xmllint --xinclude include.xml` gives:

---result---
<?xml version="1.0"?>
<sect1>
  <title>XInclude Test</title>
  <sect1><para>First Paragraph</para>
  <para/>Second Paragraph</sect1>
  <para>Third Paragraph</para>

</sect1>
---result---

I've a feeling this is a direct cause of using (or perhaps misusing?) the "range-to" function, as putting multiple xinclude instructions in, each of which gets a single paragraph, works fine.

Assuming this is caused by pilot error, I'd be grateful to anyone who can point me towards the correct syntax for achieving the expected output.

Additionally I'm being bitten by bug 132597.  Confirmation that this isn't also down to pilot error would be appreciated.

Regards,

Matt.

--



********************************************************************

This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person
Thank you

Check us out at http://www.syntegra.com

********************************************************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]