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

Re: Using outer context node inside for-each

Subject: Re: Using outer context node inside for-each
From: Richard Lewis <richard.lewis@xxxxxxxxxx>
Date: Wed, 08 Jul 2009 22:17:22 +0100
Re:  Using outer context node inside for-each
At Wed, 08 Jul 2009 13:42:59 -0400,
G. Ken Holman wrote:
> 
> At 2009-07-08 18:31 +0100, Richard Lewis wrote:
> >Hi there,
> >
> >Here is an abstraction of my problem template:
> >
> >  <xsl:template match="record">
> >    <xsl:param name="show-fields" />
> >    <xsl:variable name="this" select="." />
> >
> >    <xsl:for-each select="str:tokenize($show-fields)">
> >      <xsl:message><xsl:value-of select="$this/field[@name=.]" 
> > /></xsl:message>
> 
> Inside the predicate "." refers to the node found by the node test.
> 
> You want [@name=current()] to address the context item that is at the 
> start of the XPath expression.
> 
> Though I see Martin has taken the problem away with a more compact 
> solution ... still, you wanted to know why yours wasn't working.
> 
> I hope this helps.
> 
Excellent. Works great. Thanks very much for your help.
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard Lewis
ISMS, Computing
Goldsmiths, University of London
Tel: +44 (0)20 7078 5134
Skype: richardjlewis
JID: ironchicken@xxxxxxxxxxxxxxx
http://www.richard-lewis.me.uk/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+-------------------------------------------------------+
|Please avoid sending me Word or PowerPoint attachments.|
|http://www.gnu.org/philosophy/no-word-attachments.html |
+-------------------------------------------------------+

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.