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

RE: an Xpath question - $tag/$subtag

Subject: RE: an Xpath question - $tag/$subtag
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 8 Jul 2003 09:27:54 +0100
question tag
> At 2003-07-07 14:10 -0400, Anil wrote:
> >   here is my problem..i have to use 2 variables to reach a 
> tag in my 
> >xml, i tried using
> >
> >     <xsl:apply-templates select="$tag/$subtag">
> 

Guessing from the names of the variables, I suspect that $tag and
$subtag are variables containing element names as strings, in which case
the answer is

select="*[name()=$tag]/*[name()=$subtag]

(assuming there are no namespace complications).

Note, as we often tell people on this list, variables are not macros.
They represent values, not parts of an XPath expression. You can only
use them in places where you could use a value, or an expression such as
a function call.

Michael Kay


 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.