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

RE: How To Execute an x-path statement stored insode a

Subject: RE: How To Execute an x-path statement stored insode an variable ?
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Wed, 16 Jun 2004 14:52:24 +0100
x path
From: Jan Kohnert <J.Kohnert@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: How To Execute an x-path statement stored insode an variable ?
Date: Wed, 16 Jun 2004 13:18:47 +0200


Hello List,

I have stored x-pathes inside an varibale:

<xsl:variable name="GetItem">
  <!-- Statische Items -->
  <item name="NAME" select="BOOK/@name"/>
  <item name="ISBN" select="BOOK/@isbn"/>
	...
</xsl:variable>


The Idea is to store the x-path inside an variable, because if the XML changes, I dont want to rewrite alle my stylesheets. All I have to do is to change the contant of the variable.

My problem is, that I dont really know how to use the x-path inside the
@select attribute.

If I write
<xsl:value-of select="$GetItem/item[@name = 'NAME']/@select"/>

I get the value "BOOK/@name".

How can I use this value to use this x-path with the xml file ?


Thanks!


jan


As far as I know there is no standard way of executing dynamic xpath generically. Some systems have extension functions for doing this, Saxon has a <prefix>:evaluate method I think, and if using msxml you could either use script or a custom object as well.


--

Joe



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.