You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rob Frohwein <ro...@robf.nl> on 2007/07/31 22:52:24 UTC

variable expansion fails

Hi,

At some point in x.xslt I do:

...
<xsl:copy-of select="document('cocoon://path/proc.xsp/?var={$var}')/*"/>

....

But the variable is *not* expanded.
Proc.xsp sees the value of request-parameter var
is set to litarally {$var}

How can I pass dynamic values when 'calling' a document() ?

==================================================================

It is also possible to call a document with 2 parameters:
document('path', some-node-tree)
In my case path points to an xsp, how do I access the 'some-node-tree' ?

Thanks
Rob



	

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: variable expansion fails

Posted by Mark Lundquist <lu...@gmail.com>.
On Jul 31, 2007, at 1:52 PM, Rob Frohwein wrote:

> <xsl:copy-of 
> select="document('cocoon://path/proc.xsp/?var={$var}')/*"/>
>
> ....
>
> But the variable is *not* expanded.
> Proc.xsp sees the value of request-parameter var
> is set to litarally {$var}

That's 'cause that's what you literally wrote :-). Xpath string syntax 
doesn't comprise variably "interpolation" like that.  What you want 
would be this:

<xsl:copy-of select="document(concat ('cocoon://path/proc.xsp/?var=', 
$var, '/*')" />

HTH,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org