[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: xsl:key and document()

Subject: RE: xsl:key and document()
From: Robert Goheen <RobertG@xxxxxxxxxxx>
Date: Mon, 8 Jan 2001 17:46:54 -0800
robert goheen
> -----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)" />
   </xsl:for-each>
</xsl:for-each>

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:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.