You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Brian Minchau (JIRA)" <xa...@xml.apache.org> on 2005/07/13 06:35:17 UTC

[jira] Updated: (XALANJ-2166) Passing a nodeset by doesn't work correctly.

     [ http://issues.apache.org/jira/browse/XALANJ-2166?page=all ]

Brian Minchau updated XALANJ-2166:
----------------------------------

    fix-priority: fp2

Set to fp2, per the JIRA meeting July 12, 2005 because it is silently producing incorrect output.

> Passing a nodeset by <xsl:with-param ...> doesn't work correctly.
> -----------------------------------------------------------------
>
>          Key: XALANJ-2166
>          URL: http://issues.apache.org/jira/browse/XALANJ-2166
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: CurrentCVS, 2.6
>     Reporter: Karsten Theis

>
> Passing a nodeset by <xsl:with-param ...> like this
>             <xsl:call-template name="test2">
>                 <xsl:with-param name="nodes" select="str:tokenize($s, ' ')"/>
>             </xsl:call-template>
> doesn't work correctly.
> Output of the following xslt with XSLTC (last element is missing)
> Elements1:
> id_10019_2382
> id_10019_2383
> Elements2:
> id_10019_2382
> Output of the following xslt without XSLTC (correct)
> Elements1:
> id_10019_2382
> id_10019_2383
> Elements2:
> id_10019_2382
> id_10019_2383
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:str="http://exslt.org/strings"  exclude-result-prefixes="str">
>     <xsl:key name="ElementIndex" match="*" use="@id"/>
>     <!-- root template -->
>     <xsl:template match="/">
>         <xsl:element name="test">
>             <xsl:variable name="s">id_10019_2382 id_10019_2383</xsl:variable>
>             <xsl:call-template name="test1">
>                 <xsl:with-param name="s" select="$s"/>
>             </xsl:call-template>
>             <xsl:call-template name="test2">
>                 <xsl:with-param name="nodes" select="str:tokenize($s, ' ')"/>
>             </xsl:call-template>
>         </xsl:element>
>     </xsl:template>
>     <xsl:template name="test1">
>         <xsl:param name="s"/>
>         <xsl:variable name="nodes" select="str:tokenize($s, ' ')"/>
>         <xsl:variable name="elements" select="key('ElementIndex', $nodes)"/>
>         <xsl:message>Elements1:</xsl:message>
>         <xsl:message>
>             <xsl:value-of select="$elements[1]/@id"/>
>         </xsl:message>
>         <xsl:message>
>             <xsl:value-of select="$elements[2]/@id"/>
>         </xsl:message>
>     </xsl:template>
>     <xsl:template name="test2">
>         <xsl:param name="nodes"/>
>         <xsl:variable name="elements" select="key('ElementIndex', $nodes)"/>
>         <xsl:message>Elements2:</xsl:message>
>         <xsl:message>
>             <xsl:value-of select="$elements[1]/@id"/>
>         </xsl:message>
>         <xsl:message>
>             <xsl:value-of select="$elements[2]/@id"/>
>         </xsl:message>
>     </xsl:template>
> </xsl:transform>
> Input XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>     <Item id="id_10019_2382">
>         <Name>Hugo</Name>
>     </Item>
>     <Item id="id_10019_2383">
>         <Name>Emil</Name>
>     </Item>
> </test>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org