Bug #5916
openUsing xsl:merge with xsl:merge-source for-each-source="'input1.xml'" select="some-xpath" gives error XPDY0002 "Focus for / is absent"
0%
Description
I have tried to run an XSLT 3 example using XSLT 3's new xsl:merge through SaxonJS 2.5's xslt3
command line tool under Windows 11 with Node 16, a simple example using e.g.
<xsl:template name="xsl:initial-template">
<list>
<xsl:merge>
<xsl:merge-source name="master" for-each-source="'input1.xml'" sort-before-merge="yes" select="/list/item">
<xsl:merge-key select="@id" order="ascending"/>
</xsl:merge-source>
gives an error
Transformation failure: Error XPDY0002 at sheet1.xsl#7
Focus for / is absent
Error XPDY0002 at sheet1.xsl#7
Focus for / is absent
The code runs fine through Saxon HE 11.5 Java.
Full files attached; command line xslt3 -t -it -xsl:sheet1.xsl
gives output
SaxonJS 2.5 from Saxonica
Node.js version v16.17.1
Compiling stylesheet C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\nested-merge\sheet1.xsl
Stylesheet compilation time: 0.342s
Initial template: Q{http://www.w3.org/1999/XSL/Transform}initial-template
Asynchronous transform with options: stylesheetText={"N":"package","version":"30",(string), stylesheetBaseURI=file://C:/Users/marti/OneDrive(string), stylesheetParams=[object Object](string), outputProperties=[object Object](string), extraOptions=[object Object](string), destination=stdout(string), baseOutputURI=file://C:/Users/marti/OneDrive(string), logLevel=2(string), initialTemplate=Q{http://www.w3.org/1999/XSL/T(string),
SEF generated by SaxonJS 2.5 at 2023-03-12T13:32:13.485+01:00
Transformation failure: Error XPDY0002 at sheet1.xsl#7
Focus for / is absent
Error XPDY0002 at sheet1.xsl#7
Focus for / is absent
Files
Updated by Martin Honnen over 1 year ago
Seems a documented issue/restriction, the documentation states xsl:merge: The xsl:for-each-source attribute is not implemented.
. Too bad, kind of used by now to run nearly any XSLT 3 through SaxonJ or CS or JS, expecting full support (other than packages and schema awareness).
Updated by Martin Honnen over 1 year ago
Using <xsl:merge-source name="master" sort-before-merge="yes" select="doc('input1.xml')/list/item">
seems a workaround.
Updated by Martin Honnen over 1 year ago
Wiil for-each-source
be supported in SaxonJS 3?
Updated by Norm Tovey-Walsh over 1 year ago
I can't say off the top of my head, but creating this bug has no doubt improved the chances!
Updated by John Lumley over 1 year ago
- File signature.asc signature.asc added
Could be an interesting problem to make it asynchronous…..
Sent from my iPad
On 12 Mar 2023, at 18:21, Saxonica Developer Community notifications@plan.io wrote:
Please register to edit this issue
Also available in: Atom PDF Tracking page