Actions
Bug #4785
closedfn:path() for parentless element node gives /Q{}foo[1]
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
XPath Conformance
Sprint/Milestone:
-
Start date:
2020-10-07
Due date:
% Done:
100%
Estimated time:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-
Description
When I test fn:path
on a parentless element node in Saxon-JS 2 and XSLT 3 I get a result like /Q{}foo[1]
while Saxon Java gives Q{http://www.w3.org/2005/xpath-functions}root()
. I think Saxon-JS 2's result is a bug.
Complete stylesheet:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
expand-text="yes">
<xsl:param name="doc1">
<foo/>
<bar/>
</xsl:param>
<xsl:param name="elements" as="element()*">
<foo/>
<bar/>
</xsl:param>
<xsl:output method="html" indent="yes" html-version="5"/>
<xsl:template name="xsl:initial-template">
<html>
<head>
<title>fn:path test on parentless element nodes</title>
</head>
<body>
<section>
<h1><code>fn:path</code> of elements in document fragment node</h1>
<ol>
<xsl:for-each select="$doc1/*">
<li>node-name(): {node-name()}; path(): {path()}</li>
</xsl:for-each>
</ol>
</section>
<section>
<h1><code>fn:path</code> of parentless elements in element sequence</h1>
<ol>
<xsl:for-each select="$elements">
<li>node-name(): {node-name()}; path(): {path()}</li>
</xsl:for-each>
</ol>
</section>
</body>
</html>
<xsl:comment xmlns:saxon="http://saxon.sf.net/">Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:comment>
</xsl:template>
</xsl:stylesheet>
Please register to edit this issue
Actions
Also available in: Atom PDF Tracking page