RE: [xsl] Easy one! variables & documents)

Subject: RE: [xsl] Easy one! variables & documents)
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 1 May 2003 09:28:38 +0100
> 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[@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[@name=name(current())]/@text"/></td>
     <td>

but using a variable is probably better coding style.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


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


Current Thread