Subject: Re: 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
stylesheet.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- RE: XSLT/XPath 2.0 (was "Identifying two tags..."), (continued)
- Wendell Piez - Mon, 13 May 2002 17:59:14 -0400 (EDT)
- Roma Yankin - Thu, 9 May 2002 15:08:59 -0400 (EDT)
- Jeff Kenton - Thu, 9 May 2002 15:15:49 -0400 (EDT)
- Wendell Piez - Thu, 9 May 2002 15:17:22 -0400 (EDT)
- Mike Brown - Thu, 9 May 2002 16:04:55 -0400 (EDT) <=
- Michael Kay - Thu, 9 May 2002 18:13:14 -0400 (EDT)
- Michael Kay - Thu, 9 May 2002 07:56:56 -0400 (EDT)
- Evan Lenz - Mon, 6 May 2002 17:49:48 -0400 (EDT)
- Michael Kay - Tue, 7 May 2002 17:20:55 -0400 (EDT)
|
|