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

Re: dynamicaly build select expression

Subject: Re: dynamicaly build select expression
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 13 Sep 2001 20:56:39 +0200
build select
No, you can not use it as a string! You only can enhance Guillaume's example
to 2 nodes or more. But the number of the nodes to test is static:

<xsl:variable name="node1">n1</xsl:variable>
<xsl:variable name="node2">n2</xsl:variable>

<xsl:value-of select="/n0/*[name()=$node1]/*[name()=$node2]/n3"/>

A further version, not very nice, contrary very poor, could be the
following: Match on all n3, build a string of all the names of the ancestors
with the '/' as delimiter and compare this string to your variable some_name
from your first mail.

And a third: Match on n0, from there match on this node, which has the name
substring-before($some_name,'/') and give the
substring-after($some_name,'/') to the next template (xsl:with-param). Do
this until the param $some_name is empty.



----- Original Message -----
From: "Dmitri Ilyin" <dmitri.ilyin@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, September 13, 2001 5:57 PM
Subject: RE:  dynamicaly build select expression

> thanks
> will it also work if i have:
> <xsl:variable
> name="some_name">node[@name='n1']/node[@name='n2']</xsl:variable>
> >
> > Ainsi parlait Dmitri Ilyin :
> > > Hi *,
> > >
> > >
> > > how can i build expression "select" in <xsl:value-of select=""/>
> > > dynamicaly, using xsl:variable
> > > for example:
> > >
> > > <xsl:variable name="some_name">node1/node2</xsl:variable>
> > > <xsl:value-of select="/node0/$some_name/node_n"/>
> > <xsl:value-of select="/node0/*[name()=$some_name]/node_n"/>

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

Current Thread


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.
First Name
Last Name
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.