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

Re: Variable in XPath...

Subject: Re: Variable in XPath...
From: Alessio Mazzieri <mazzieri@xxxxxxxxxxx>
Date: Fri, 09 Nov 2001 09:33:29 +0100
xpath contains variable

David Carlisle wrote:


The $node_id contains the exact node name.


I suspect you have the wrong model of what's happening.


It's a bit hard to tell as you didn't show th eformat of either of your
input files, but I guess

config.xml looks like
<config>
<nodename>xxx</nodename>
</config>

if so then $node_id contains a single element node (nodename)

so

<xsl:for-each select="$node_id">

will select that node (in config_doc.xml, not any nodes in the original
document)

Ohh!? The $node_id variable contains a "string" (obviously intended as a single node tree fragment contains a text), not a tree fragment related to config_doc.xml. Or not?
In every way, the suggested method


<xsl:for-each select="//*[name()=$node_id]">

seems to work. Thank's again.

Alessio Mazzieri


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.