Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.7.1
-
None
-
None
Description
I try to use scripts within xslt style sheets, but I can not transfer node sets as parameters to the functions. Instead of Nodeiterators the retrieved objects are always from type org.apache.xml.utils.NodeVector with a size of 0. I tried JavaScript and Jruby as languages.
Here a sample style sheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ext="ext" xmlns:xalan="http://xml.apache.org/xalan" version="1.0">
<xsl:output method="xml" encoding="UTF-8"/>
<xalan:component functions="test" prefix="ext">
<xalan:script lang="javascript"><![CDATA[
function test(nodes)
]]></xalan:script>
</xalan:component>
<xsl:template match="/">
<name>
<xsl:value-of select="ext:test(/ResultSet/row)"/>
</name>
</xsl:template>
</xsl:stylesheet>
XML:
<?xml version="1.0" encoding="UTF-8"?>
<ResultSet>
<row>
<id>1000000074</id>
</row>
<row>
<id>1090</id>
</row>
<row>
<id>12552</id>
</row>
<row>
<id>245858</id>
</row>
</ResultSet>
The result is:
<?xml version="1.0" encoding="UTF-8"?><name xmlns:xalan="http://xml.apache.org/xalan" xmlns:ext="ext">org.apache.xml.utils.NodeVector@13a317a 0</name>