You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ovidiu Predescu <ov...@cup.hp.com> on 2001/04/24 23:25:33 UTC

Re: is there something like

On Tue, 24 Apr 2001 17:39:35 +0200, Elmar Christen <el...@elmartec.de> wrote:

> Hi there, it's me -again- with the same question.
> We are having this problem, working on it for several days now,  
> consulted some mailing-lists archives and still haven't found the  
> solution.
> We need something like:
> <xsl:value-of select="$var"/>
> The variable "var" holds as value a string which happens to be a XPath 
> (!) to a node within the same document, like, for example 
> $var="/root/here/there"
> and the XML doc has amoung other this
> <root>
>   <here>
>       <there>ELMAR</there>
>    </here>
>      ...
> </root>
> The result of which we hope to get in this case <xsl:value-of  
> select="$var"/> should be "ELMAR". But, of course, with <xsl:value-of  
> select="$var"/> we get just the path-string "/root...".
> Maybe, this is simply not possible with just XSL ? Maybe this has to be 
> done with some tricky XSPs? If so, how?

What you're asking for is essentially the ability to programatically
construct XPath expressions at runtime and then obtain the nodeset in
a given XML node context.

You cannot do this with a pure XSLT 1.0 processor. However you can
make use of the `evaluate' extension available with both Xalan and
Saxon to evaluate dynamically generated XPath expressions. Look at
their documentation for specific information on how to use them.

> (Greeting from Barcelona - it's sunny and warm outside)

Same greetings from here, in the San Francisco Bay Area, where it's
sunny and just beautiful outside.

-- 
Ovidiu Predescu <ov...@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>