Re: [xsl] What do we have in variable?

Subject: Re: [xsl] What do we have in variable?
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 9 May 2002 14:11:26 -0600 (MDT)
Roma Yankin wrote:
> I'm just trying to understand, whenever we initialize some variable for
> example in that way <xsl:variable name="somevar" select="ancestor::*"/>
> what do we have stored inside it? Is it an array or some root node?

In this case, an unordered collection of nodes (most likely, all the element
nodes that are ancestors of the current node): a "node-set".

The XPath spec explains that there are 4 basic types of objects:
  boolean, number, string, node-set.

XSLT 1.0 adds one more:
  result tree fragment.  (a special type of node-set).

When you create a variable, you are naming an object, and possibly creating
the object at the same time, if it didn't already exist. The variable isn't
really a container, it is a binding of a name to an object, and the object is
one of those 5 types listed above.

The binding of the name to the object is permanent (you can't modify the 
object or the name), but its scope is limited to only certain places in the 

   - Mike
  mike j. brown                   |  xml/xslt:
  denver/boulder, colorado, usa   |  resume:

 XSL-List info and archive:

Current Thread