xsl-list
[Top] [All Lists]

Re: Easy one! variables & documents)

2003-04-30 14:45:41
----- Original Message ----- 
From: "Karl J. Stubsjoen" <karl(_at_)azprogolf(_dot_)com>


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


This creates an RTF (Result Tree Fragment) rather than a node-set.  If you
populate the variable like this:

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

You will get a node-set in the variable.  Note also that //  is an expensive
production for a processor.  Point the select statement directly at the node
parenting your desired node-set.

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


<xsl:for-each select="$xmTmplt/FLD">

will then function properly.

hth,

Mike


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



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