Re: Variables and Parameters within Templates

TOM wrote:
> 
> Le 21/11/00 05:30:00, James Clark a écrit :
> > xsl:variable is in the category "instruction", but xsl:param is not.
> > Thus xsl:for-each can have xsl:variable children but not xsl:param
> > children.
> 
> Oh sorry, I wasn't clear.
> 
> > > the Rec isn't very clear about what is a "template".
> > > In 11.5 :
> > >   "It is an erreor if a binding established by an xsl:variable or
> > >    xsl:param element within a template shadows another binding
> > >    established by an xsl:variable or xsl:param also within the
> > >    template. It is not an erreor if a binding established by an
> > >    xsl:variable or xsl:param element in a template shadows another
> > >    binding established by an xsl:variable or xsl:param top-level
> > >    element."
> 
> Here only 2 "levels" are described : 2 variables or parameters within the
> same template, 2 variables or parameters at different places : one in a
> template, the other at top-level.
> Though what's called a template exactly ? Do the word "template" here only
> refer to xsl:template ?

I think I see where the problem is now.

You are correct in saying that there are two levels: (1) at the
top-level (2) anywhere else where the syntax summary allows it. (2) is
called "in a template".  Level (2) variables can shadow level (1)
variables, but no level (2) variable can shadow any other level (2)
variable.

There's a bug in the text. In 

"It is an erreor if a binding established by an xsl:variable or
xsl:param element within a template shadows another binding
established by an xsl:variable or xsl:param also within ***the***
template."

The highlighted "the" should be "a".

Does this make things clear?

James

Received on Wednesday, 22 November 2000 01:31:06 UTC