W3C home > Mailing lists > Public > www-xml-xinclude-comments@w3.org > January 2004

XPointer example error

From: Daniel Veillard <daniel@veillard.com>
Date: Wed, 7 Jan 2004 19:42:42 +0100
To: www-xml-xinclude-comments@w3.org
Message-ID: <20040107184242.GA32002@daniel.veillard.com>

  The range inclusion example has a small XPointer error:
    http://www.w3.org/TR/2003/WD-xinclude-20031110/#range-example

xpointer(string-range(chapter/p[1],'Sentence 2')/
             range-to(string-range(chapter/p[2]/i,'3.',1,2)))

  the range-to is constructed from the location set found in the
initial lookup, i.e. from a point given in /chapter/p[1] ,
and at that point there exist no "chapter/p[2]/i" node. I believe
the simplest is to change it to "/chapter/p[2]/i", i.e.

xpointer(string-range(chapter/p[1],'Sentence 2')/
             range-to(string-range(/chapter/p[2]/i,'3.',1,2)))

  It might be a good idea to initialize the fist path as /chapter/p[1]
but not needed.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | 
Received on Wednesday, 7 January 2004 13:45:29 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.30 : Thursday, 9 June 2005 12:16:09 GMT