RE: [xsl] xsl:key and document()

Subject: RE: [xsl] xsl:key and document()
From: Robert Goheen <RobertG@xxxxxxxxxxx>
Date: Mon, 8 Jan 2001 17:46:54 -0800
> -----Original Message-----
> From: David Carlisle [mailto:davidc@xxxxxxxxx]

> Why wouldn't you want to use a variable?

Actually, its because I keep getting mixed up and asking dumb questions....

For a moment, I forgot that variables were set only within the context, so
you could set them again once you left that scope.  Because being unable to
never change a variable was so alien to me, and because I had to radically
change my thinking, I've wound up swinging too far to the left and developed
a fear of setting a variable twice in an XSLT.

To put it more concisely, I forgot that this was acceptable:

<xsl:for-each select="Tag">
   <xsl:variable name="TagID" select="@ID" />
   <xsl:for-each select="document('LUType.xml')">
      <xsl:value-of select="key('LUType', $TagID)" />

Because I knew the xsl:variable would be called multiple times.  At least,
I'm making fewer silly mistakes per day.....

 XSL-List info and archive:

Current Thread