[ 
https://issues.apache.org/jira/browse/XALANJ-2507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790758#action_12790758
 ] 

Henry Zongaro commented on XALANJ-2507:
---------------------------------------

It looks like only the first use of a particular variable instance inside of 
dyn:evaluate is working - so in your example, $Member/dev returns the correct 
result, but it looks like the second and third references to each particular 
instance of $Member return empty node sets.

In your simple example, it would be possible to work around the problem so that 
it doesn't use the dyn:evaluate function at all:

<xsl:for-each select="member">
<xsl:variable name="Member" select="."/>
<tr>
<td><xsl:value-of select="name"/></td>
<xsl:for-each select="../RoleTypes/*">
<xsl:variable name="roleName" select="name(.)"/>
<td><p/><xsl:value-of select="$Member/*[name(.) = $roleName"/></td>
</xsl:for-each>
</tr>
</xsl:for-each>

Of course, that might not work in your particular stylesheet, if your usage of 
dyn:evaluate is more complex.

> dyn:evaluate() not working correctly when RTF is passed
> -------------------------------------------------------
>
>                 Key: XALANJ-2507
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2507
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>    Affects Versions: 2.7.1
>         Environment: WindowsXP with cygwin, Java version: "1.6.0_15", 
> xalan-j: 2.7.1
>            Reporter: Krishna
>
> When dyn:evaluate is used to process a node, something goes wrong when xalan-j
> processor is used.  The same stylesheet works fine with other processors (i.e.
> xsltproc, saxon6 etc).
> The xsl segment that causes trouble is:
> <xsl:for-each select="member">
>       <xsl:variable name="Member" select="."/>
>       <tr>
>       <td><xsl:value-of select="name"/></td>
>       <xsl:for-each select="../RoleTypes/*">
> ==>           <td><p/><xsl:value-of select="dyn:evaluate(concat('$Member/', 
> name(.)))"/></td>
>       </xsl:for-each>
>       </tr>
> </xsl:for-each>
> The idea is to display data under <dev>, <qa>, and <doc> in tabular form like
> name |  dev |  qa | doc |
> -------------------------------
> John   |  200 |      |         |
> Paul   |  100 |       |         |
> Max    |           | 60 |         |
> But, when I use xalan-j, only the data pertaining to the first element under 
> RoleTypes
> (i.e. <dev> in this case) gets displayed, rest of the columns are blank.  I'm 
> not that
> comfortable with java to see where the problem is in the source code.  Just 
> thought
> I'd pass on this info.
> Input XML content is:
> <projectteam>
>   <RoleTypes>
>         <dev/>
>         <qa/>
>         <doc/>
>   </RoleTypes>
>   <member>
>     <name>John</name>
>     <dev>200</dev>
>   </member>
>   <member>
>     <name>Paul</name>
>     <dev>100</dev>
>   </member>
>   <member>
>     <name>Max</name>
>     <qa>60</qa>
>   </member>
>   ...
> Thanks

-- 
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: xalan-dev-unsubscr...@xml.apache.org
For additional commands, e-mail: xalan-dev-h...@xml.apache.org

Reply via email to