You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Derek Settle <De...@2roam.com> on 2000/05/07 23:11:49 UTC

RE: VariableReference given for variable out of context or withou t de finition!

Thank Scott!

I agree with your recommendations and will (do the deed and) make the
changes in my code.

Your reply/confirmation is much appreciated!

-Derek

-----Original Message-----
From: Scott Boag/CAM/Lotus [mailto:Scott_Boag@lotus.com]
Sent: Sunday, May 07, 2000 11:59 AM
To: Derek Settle
Cc: xalan-dev@xml.apache.org
Subject: 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