[xml] Problems with changed XInclude behavior



Greetings!

When I recently updated my Debian system and started to receive warnings
because of a deprecated XInclude namespace, I tried changing all the files
of a project I'm currently working on to use the new spec.

Now, as long as I only use the href attribute of xi:include I get the
result that I expect; the problem is that, for some reason, I'm unable to
get the xpointer attribute to do anything at all!

Let's take the following two files for example:

---[ foo.xml ]---
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE foo [
  <!ELEMENT foo (xi:include)>
  <!ATTLIST foo
            xmlns:xi CDATA "http://www.w3.org/2003/XInclude";>
  <!ELEMENT xi:include EMPTY>
  <!ATTLIST xi:include
            href CDATA #REQUIRED
            xpointer CDATA #IMPLIED> ]>
<foo xmlns:xi="http://www.w3.org/2003/XInclude";>
  <xi:include href="bar.xml" xpointer="xpointer(bar/batz)"/>
</foo>
---

---[ bar.xml ]---
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE bar [
  <!ELEMENT bar (batz)>
  <!ELEMENT batz EMPTY> ]>
<bar>
  <batz/>
</bar>
---

When I run `xmllint --xinclude foo.xml' what I'd expect is for the <batz/>
element from bar.xml to replace the <xi:include> element in foo.xml.  For
some reason that doesn't happen, though.  I just get the same output that
I get without the xpointer argument.

Is it me that is missing something here or is this a bug in libxml?

Regards,
Lars

PS/FYI:
---8<---
lars[~]: xmllint --version
xmllint: using libxml version 20603
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude Iconv Unicode Regexps Automata 
Schemas
--->8---



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