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

RE: Pass node to template

Subject: RE: Pass node to template
From: David Neary <David@xxxxxxxxx>
Date: Tue, 20 May 2003 17:50:49 +0200
xsl pass nodeset to template

De : Karl J. Stubsjoen [mailto:karl@xxxxxxxxxxxxx]
> Hello,

Hi.

>     <xsl:variable name="EDITPROP" select="EDITPROPS"/>

Here the variable EDITPROP is a reference to the nodeset matching the XPath
expression in the select (EDITPROPS).

>              <xsl:call-template name="MAKE_INPUT_BOX">
>                 <xsl:with-param name="nodEdit"><xsl:value-of
> select="$EDITPROP" /></xsl:with-param>

Here nodEdit is not a nodeset, but a tree fragment. That is, the parameter
is the bit of a tree between the end of the <xsl:variable> and the start of
the </xsl:variable>

>                 </xsl:call-template>
> 
> Here is the beginning part of my template that fails:
> <xsl:template name="MAKE_INPUT_BOX">
>     <xsl:value-of select="$nodEdit/@type"/>

You can't do tree operations on a result fragment. What you want is to
actually pass the nodeset into the template. To do that, change the
with-param to 

<xsl:with-param name="nodEdit" select="$EDITPROP" />

Now, the parameter type in the template is the type of the expression
"$EDITPROP", which presumably is a nodeset.

Cheers,
Dave.


 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.