Subject: RE: dyn:evaluate question
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 23 Mar 2005 13:19:42 -0000
|
We used to get a lot of variations on attempts to do dynamic inclusion, but
this is one of the most imaginative.
xsl:include is a compile time construct, it's effect happens right at the
start of processing, to assemble a stylesheet for compilation. There's no
way a variable can be evaluated before the stylesheet has been compiled, so
trying to refer to a variable here simply isn't going to work.
dyn:evaluate() does things at run-time that would normally be done at
compile-time, it isn't going to enable you to do at compile time something
(evaluating a variable) that can only possibly be done at run-time.
You don't need a workaround, you need a different design: but you haven't
said what the problem is, so I can't give you one.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: Thorsten Scherler [mailto:thorsten@xxxxxxxxxx]
> Sent: 23 March 2005 13:00
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: dyn:evaluate question
>
> Hello list,
>
> I am trying to dynamically include a stylesheet like this:
> <xsl:variable name="request">index</xsl:variable>
> <xsl:include href="cocoon:/prepare.include.dyn:evaluate($request)"/>
>
> but the dyn:evaluate($request) -part will not get resolved.
>
> As soon I change it to
> <xsl:include href="cocoon:/prepare.include.index"/>
> I get my stylesheets.
>
> Am I using the dyn:evaluate wrong? Are there a workaround?
>
> TIA
> --
> thorsten
>
> "Together we stand, divided we fall!"
> Hey you (Pink Floyd)
|