Actions
Bug #6227
closeddocument-uri() not working when using collection()
Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Start date:
2023-10-18
Due date:
% Done:
0%
Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
Fixed in version:
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:
Description
I'm using saxonche version 12.3.0 installed using pip.
When using collection()
in XSLT, document-uri()
doesn't seem to be working.
I've created a small test and have attached a zip containing the Python, XSLT, and input files.
Python (using version 3.11.5)
import saxonche
with saxonche.PySaxonProcessor(license=False) as proc:
xsltproc = proc.new_xslt30_processor()
executable = xsltproc.compile_stylesheet(stylesheet_file="test.xsl")
content = executable.call_template_returning_string()
print(f"\ncontent:\n{content}")
XSLT 3.0
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" expand-text="yes">
<xsl:output indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template name="xsl:initial-template">
<xsl:for-each select="collection('input?select=*.(xml|XML)&content-type=application/xml')">
<xsl:message>Processing "{document-uri()}"...</xsl:message>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Output
Processing ""...
Processing ""...
Processing ""...
content:
<doc>First test XML instance.</doc>
<doc>Second test XML instance.</doc>
<doc>Third test XML instance.</doc>
The document URI is not in the "Processing" messages.
Files
Please register to edit this issue
Actions