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

Re: Q: Passing constructed elements as parameters

Subject: Re: Q: Passing constructed elements as parameters
From: george.fink@xxxxxxx
Date: Wed, 31 Jan 2001 11:44:48 -0800
el passing parameters
> 
> 
>    Hi, I'm trying to do something like:
> 
>    <xsl:apply-template>
>      <xsl:with-param name="foo">
>        <xsl:element name="bar"> ... </xsl:element>
>      </xsl:with-param>
>    </xsl:apply-template>
> 
>    <xsl:template>
> assuming you mean <xsl:template match="xxx"> here
> 
>      <xsl:param name="foo"/>
>      <xsl:for-each select="$foo/bar"/>
>    </xsl:template>
> 
>    But something seems to be lost in the translation.  Is there some conversion 
>    step I'm missing?
> 
>    --George
> 
> 
> if the xxx element that matches the second template is a direct
> child of the template that has the apply-templates code at the top
> then it will see the seting of the foo parameter. (otherwise it won't as
> parameters are not passed on by default)
> 
> However if you go
> 
> <xsl:with-param name="foo">
>  ....
> </xsl:with-param>
> 
> rather than
> 
> <xsl:with-param name="foo" select="..."/>
> 
> 
> then $foo wilkl be a result tree fragment rather than a node set,
> so you can not query into it with  <xsl:for-each select="$foo/bar"/>
> 
> It's not clear from what you've posted whether you want to use th e
> <xsl:with-param name="foo" select="..."/> for and have $ foo
> being a set of nodes in the input document, or whether you did intent to 
> construct a new node set, in which case you processor may have a
> node-set() extension function, used as
> 
>  <xsl:for-each select="xt:node-set($foo)/bar"/>
> 

The intent was to have it be a node set so I can query it with $foo/bar, or do 
a apply-templates on it if I need to.

So the node-set function isn't a standard, I'm using xalan right now, if its 
not there I guess I need to change engines.

Thanks for your help.

--George


 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.