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

Re: [xml] Problems with changed XInclude behavior



On Fri, Dec 19, 2003 at 06:05:03AM +0100, Lars Weber wrote:
> 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!

  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 "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?

  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

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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