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

Problems with for-each

Subject: Problems with for-each
From: "Kevin Nardi" <kevnardi@xxxxxxxxxxx>
Date: Thu, 12 Jul 2001 12:30:56 -0700
problems with for each
In an XSL stylesheet, I have a template with a code fragment that looks like this:

<xsl:template match="item">
	<tr>
		<xsl:for-each select="//itemList/headerList/header">
			<xsl:if test="name = 'title'">
				<xsl:apply-templates select="title" />
			</xsl:if>
		</xsl:for-each>
	</tr>
</xsl:template>

An <item> element looks like this:

<item>
	<title>Item 1</title>
	<identifier>aab</identifier>
	etc...
</item>

My problem is that inside of the for-each loop, the context changes to that of //itemList/headerList/header, and I lose the context of the current item I'm working with, so the select="title" is invalid. How do I get my context back?

Thanks.

-Kevin
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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.