[ 
http://issues.apache.org/jira/browse/XALANJ-2293?page=comments#action_12420653 
] 

Brian Minchau commented on XALANJ-2293:
---------------------------------------

Henry Zongaro also found that when run with xalan interpretive
the problem does not exist in the latest development code,
but does exist in the 2.7.0 release.

So this fix should be picked up with the next release of xalan.
This issue was triaged on July 11,  2006.

> Error counting nodes when using a variable
> ------------------------------------------
>
>          Key: XALANJ-2293
>          URL: http://issues.apache.org/jira/browse/XALANJ-2293
>      Project: XalanJ2
>         Type: Bug

>   Components: Xalan
>     Versions: 2.7
>     Reporter: Ricotta
>     Priority: Critical
>      Fix For: Latest Development Code

>
> Consider the following XML file:
> ---------------------------------------------------
> <xmldata>
>     <value/>
>     <value/>
> </xmldata>
> ---------------------------------------------------
> Consider the following XSL file:
> ---------------------------------------------------
> <xsl:stylesheet version = '1.0' 
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
> <xsl:variable name="doc" select="xmldata"/>
> <xsl:template match="xmldata">
> <html>
>   <head/>
>   <body>
>   
>    Number of elements: <xsl:value-of select="count($doc/value)"/>
>    <br/>
>    Number of elements: <xsl:value-of select="count($doc/value)"/>
>    <br/>
>   </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
> ---------------------------------------------------
> As you can see, the output should be an html page showing the total number of 
> elements twice. However, this is the output:
> ---------------------------------------------------
> Number of elements: 2
> Number of elements: 4
> ---------------------------------------------------
> Now consider the following XSL file:
> ---------------------------------------------------
> <xsl:stylesheet version = '1.0' 
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
> <xsl:template match="xmldata">
> <xsl:variable name="doc" select="."/>
> <html>
>   <head/>
>   <body>
>   
>    Number of elements: <xsl:value-of select="count($doc/value)"/>
>    <br/>
>    Number of elements: <xsl:value-of select="count($doc/value)"/>
>    <br/>
>   </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
> ---------------------------------------------------
> Now the output is correct:
> ---------------------------------------------------
> Number of elements: 2
> Number of elements: 2
> ---------------------------------------------------
> Comparing the two XSL files, the only diference is that the "doc" variable is 
> declared outside or inside the template.
> Thank you!

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to