You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Scott Boag/CAM/Lotus <Sc...@lotus.com> on 2000/05/07 20:58:33 UTC
Re: VariableReference given for variable out of context or without de
finition!
Derek Settle <De...@2roam.com> wrote:
> XSL Error: pattern = 'starts-with($link, 's')'
> VariableReference given for variable out of context or without
definition!
Hi Derek. I'm not sure from a glance why you would be getting an undefined
variable error here. The "link" variable reference should be in the scope
of <xsl:variable name="link"></xsl:variable>. In order for me to fully
debug this, you'll need to send me a complete example.
> I realize this may have been a bug in the way I was coding the
style-sheet
> but is there a way to get this to work without having to completely
re-write
> all existing style-sheets which use the same methodology?... (I never
> realized I was coding a hack when I initially started with XSL... I think
> this approach should actually be an enhancement!)
If you're counting on "link" being re-bound in the choose statement, I
can't help you there. You may disagree with how XSLT works, but it would
be wrong of me to change how Xalan works in accordance to the standard...
it's declarative nature was done for a reason. The only way you could work
around this is with an extension. I would encourage you to rethink the
code to a purely declarative style, which will probably be more
straight-forward anyway. For instance, I suspect you could make a single
parameterized template that you could call to replace the name
="{normalize-space($link)}" and some of the xsl:choose stuff ahead of it.
Parameterized templates are very powerful.
-scott