xsl-list
[Top] [All Lists]

Re: Easy one! variables & documents)

2003-04-30 14:27:17
You must have the dollar sign to access the variable.
Note that you are selecting FLD rather than FLDS.

<xsl:template name="TEMP">
<hr/>
 <xsl:for-each select="$xmTmplt/FLD">
    <xsl:text>testing..</xsl:text>
 </xsl:for-each>
<hr/>
</xsl:template>

-rick

At 02:07 PM 4/30/03 -0700, you wrote:
I am reading an external xml document into a variable at the very top of my
stylesheet (is this legal?)... later I loop through this document.. but I
don't know how to access the variable in a select statement (it doesn't like
the $ in the select statement).  Here's the code:

<xsl:variable name="xmTmplt"><xsl:copy-of
select="document('usr_member.xml')//FLDS"/></xsl:variable>

<xsl:template name="TEMP">
<hr/>
 <xsl:for-each select="xmTmplt/FLD">
    <xsl:text>testing..</xsl:text>
 </xsl:for-each>
<hr/>
</xsl:template>

Should yield:
testing..testing..testing..testing..testing..testing..

Thanks,
Karl


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

Rick Taylor
XML Developer
PPDM Association


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



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