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

Re: xpath query in an attribute

Subject: Re: xpath query in an attribute
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Wed, 24 Oct 2001 16:59:02 +0200
dynamic xpath queries
Balazs Scheidler wrote:

Hi,

I'm new to XSL, and I'm not sure whether I did something wrong or xalan (the
xslt engine I use is buggy).

So I want to run an XPath query I extracted from an attribute in the XML
document.

Here's what I did:

    <xsl:variable name="query" select="@select"/>
    <xsl:value-of select="$query"/>

The first statement extracts the select attribute from the current node, and
the second _should_ run the query in $query, and return the accompanying
node-set. The problem is that it doesn't, it displays the value of the query
itself.

My question is: how to execute string variables as XPath queries? Any help
welcome.
First of all variable 'query' will actualy hold result of evaluating XPath

expression "@select" but not this expression itself. Read more about variables in xslt.

And second - pure XSLT doesn't

support dynamic XPath expression. If you really want to run that stuff you should probably to use xalan:evaluate() extension function.


-- Oleg Tkachenko Multiconn International, Israel


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.