GNOME Bugzilla – Bug 152305
xpointer range-to + xsltproc via document()
Last modified: 2021-07-05 11:00:07 UTC
Here is the test-case (stick all 3 files in the same dir): $ xsltproc xpointer-queries.xml Should not fail, but fails with: runtime error: file xpointer-transfo.xsl line 11 element copy-of document() : XPointer does not select a node set: #�nter(id('b1')/range-to(id('b3'))) no result for xpointer-queries.xml To make it 'work', just comment-out the last <ref/> in xpointer-queries.xml xsltproc --version says Using libxml 20609, libxslt 10108 and libexslt 806 xsltproc was compiled against libxml 20609, libxslt 10108 and libexslt 806 libxslt 10108 was compiled against libxml 20609 libexslt 806 was compiled against libxml 20609 Also note that using an xinclude version of this does work [2. text/xml; xpointer-queries.xml] <?xml-stylesheet href="xpointer-transfo.xsl" type="text/xsl"?> <!-- use xsltproc xpointer-queries.xml --> <refs> <!-- These work --> <ref>xpointer-source.xml#xpointer(/AAA/BBB[1])</ref> <ref>xpointer-source.xml#xpointer(id('b1'))</ref> <ref>xpointer-source.xml#xpointer(id('b3'))</ref> <!-- This on does not runtime error: file xpointer-transfo.xsl line 11 element copy-of document() : XPointer does not select a node set: #XXXXX%@nter(id('b1')/range-to(id('b3'))) --> <ref>xpointer-source.xml#xpointer(id('b1')/range-to(id('b3')))</ref> </refs> [3. text/xml; xpointer-transfo.xsl] <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="ref"> <annotation> <xsl:copy-of select="."/> <value> <xsl:copy-of select="document(.)"/> </value> </annotation> </xsl:template> <!-- recurse --> <xsl:template match="@*|node()"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> [4. text/xml; xpointer-source.xml] <!DOCTYPE AAA [ <!ELEMENT AAA (AAA+|BBB+)> <!ELEMENT BBB EMPTY> <!ATTLIST BBB id ID #REQUIRED> ] > <!-- ID-ness *must* be declared for id() references to work --> <AAA> <BBB id="b1"/> <BBB id="b2"/> <AAA> <BBB id="b3"/> <AAA> <BBB id="b4"/> <AAA/> </AAA> </AAA> </AAA>
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxslt/-/issues/ Thank you for your understanding and your help.