Actions
Bug #6336
closedpassing an array as a parameter results in an object has no attribute 'derivedaptr'
Start date:
2024-01-31
Due date:
% Done:
100%
Estimated time:
Applies to branch:
Fix Committed on Branch:
12
Fixed in Maintenance Release:
Found in version:
12.4.2
Fixed in version:
12.5
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:
Description
I'm trying to pass an array to a stylesheet:
with PySaxonProcessor(license=False) as proc:
print(proc.version)
xsltproc = proc.new_xslt30_processor()
xsltproc.set_cwd(os.getcwd())
executable = xsltproc.compile_stylesheet(stylesheet_file="cat.xsl")
value = proc.make_array([proc.make_integer_value(i) for i in [8,9,10]])
print(value)
executable.set_parameter("values", value)
result = executable.apply_templates_returning_string(source_file="person.xml")
print(result)
However, this results in:
SaxonC-HE 12.4.2 from Saxonica
[8,9,10]
Traceback (most recent call last):
File "/Users/menzowi/Temp/saxontest/saxon.py", line 22, in <module>
executable.set_parameter("values", value)
File "python_saxon/saxonc.pyx", line 1958, in saxonche.PyXsltExecutable.set_parameter
AttributeError: 'saxonche.PyXdmArray' object has no attribute 'derivedaptr'
I expected a result an XML document with each of the values in the array multiplied by 3. Using this sytlesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsl:param name="values" select="(2, 3, 4, 5)"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*">
<output>
<xsl:for-each select="$values">
<out>
<xsl:value-of select=". * 3"/>
</out>
</xsl:for-each>
</output>
</xsl:template>
</xsl:stylesheet>
Files
Related issues
Please register to edit this issue
Actions