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

RE: Help on node selection

Subject: RE: Help on node selection
From: "Fabien Tillier" <f.tillier@xxxxxxxx>
Date: Fri, 27 Aug 2010 16:55:26 +0200
RE:  Help on node selection
Martin, I have just a last question for the week...
In my template, I get data, because using
<xsl:value-of select="."/>
I get a bunch of data
But, how can I access to each individual node ?
With
<xsl:for-each select=".">
	<xsl:value-of select ="row/N2"/>,
</xsl:for-each>
I get nothing... (complete template below)

<xsl:template name = "domain">
	<xsl:param name="rows" as="element(row)*"/>
	<!--<xsl:value-of select="."/>-->
	<xsl:for-each select=".">
		<xsl:value-of select ="row/N2"/>,
	</xsl:for-each>
</xsl:template>

Thanks !

Regards,
Fabien


-----Message d'origine-----
De : Martin Honnen [mailto:Martin.Honnen@xxxxxx]
Envoyi : vendredi 27 ao{t 2010 14:27
@ : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : Re:  Help on node selection

Fabien Tillier wrote:
> Well, it is not what I want. The XML is a lot more complex
> That's why I didn't put an output at first...
> I want to know the syntax to call a template with a list of nodes, based on
a criteria.

If you use a template with a match attribute, then there will always
exactly one current node when the template is processed with
apply-templates.

You could however define a parameter and pass in a node-set (XSLT 1.0)
or sequence of nodes (XSLT 2.0) e.g.
   <xsl:template name="n1">
     <xsl:param name="rows" as="element(row)*"/>
     ...
   </xsl:template>


   ...<xsl:call-template name="n1">
        <xsl:with-param name="rows" select="data/row[N1=1]"/>
      </xsl:call-template>



--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.