Re: [xml] Problems with changed XInclude behavior

On Fri, Dec 19, 2003 at 06:05:03AM +0100, Lars Weber wrote:

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!

  strange, it's supposed to work, see test/XInclude/docs/nodes2.xml

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 "";>
  <!ELEMENT xi:include EMPTY>
  <!ATTLIST xi:include
            href CDATA #REQUIRED
            xpointer CDATA #IMPLIED> ]>
<foo xmlns:xi="";>
  <xi:include href="bar.xml" xpointer="xpointer(bar/batz)"/>

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

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?

  Strange I don't see an obvious bug in your example. But I don't
see how it really differs from test/XInclude/docs/nodes2.xml .
Have you tried using xpointer(/bar/batz) ?


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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