This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

AW: xpath query in an attribute


Dear Balazs

> -----Ursprüngliche Nachricht-----
> Von: Balazs Scheidler [mailto:bazsi@balabit.hu]
> Gesendet: Mittwoch, 24. Oktober 2001 16:32
> An: xsl-list@lists.mulberrytech.com
> Betreff: [xsl] xpath query in an attribute
> 
> 
> 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.

In order to achieve this, you have to use an extension function.
For example in xalan it would be 

evaluate(string)

which constructs an XPath.

> 
> -- 
> Bazsi
> PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 
> 804E C82C 8EB1
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]