xsl-list
[Top] [All Lists]

RE: Easy one! variables & documents)

2003-05-01 01:28:38
I GOT IT!!!!!!

     <xsl:for-each select="@*">
     <xsl:variable name="name" select="name()"/>
        <tr>
        <td><!-- lookup text for display in xml template -->
        <xsl:value-of select="$xmTmplt[(_at_)name=$name]/@text"/></td>
     <td>
        ....

Is this the way to do it?  Did I need to declare the variable 
name, or could I have accessed name directly from the select?

You could have used 

     <xsl:for-each select="@*">
         <tr>
         <td><!-- lookup text for display in xml template -->
         <xsl:value-of
select="$xmTmplt[(_at_)name=name(current())]/@text"/></td>
     <td>

but using a variable is probably better coding style.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>