Empty NodeVector in scripts
---------------------------

                 Key: XALANJ-2441
                 URL: https://issues.apache.org/jira/browse/XALANJ-2441
             Project: XalanJ2
          Issue Type: Bug
          Components: Xalan-extensions
    Affects Versions: 2.7.1
            Reporter: Olaf


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){
                return ""+nodes+" "+nodes.size();
        }
]]></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">[EMAIL PROTECTED] 
0</name>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to