Re: [xsl] Parameters in XPath

Subject: Re: [xsl] Parameters in XPath
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 7 Jan 2003 13:26:13 GMT
> What I'm trying to accomplish with the Filter
> parameter is to dynamically pass into the stylesheet a
> XPath expression to be evaluated.

Searching the archives for "dynamic" will reveal this to be a FAQ.

Like most other programming languages, XSLT can not evaluate a string
as an expression and doesn't have expressions as first class objects, so
you can not have an expression valued variable.

Some systems (xalan, saxon,...) have an evaluate extension function that
will evaluate a string as an xpath expression.

Alternatively many API allow you to pass in the node set (selected by an
XPath) rather than the xpath expression.

so then you'd have
<xsl:param name="nodes"/>

<xsl:apply-templates
select="$nodes"/>


and you'd set the value of nodes to be the node set selected by
/sdfa/sgag/ergewg/ergwe
using (say) an XPath interface to a DOM.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread