Subject: RE: Node Set and Node List differentiation From: Kay Michael <Michael.Kay@xxxxxxx> Date: Tue, 15 Jun 1999 10:09:08 +0100 |
> I inferred the following based on the context. Can somebody > please confirm or clarify the following. > > Node Set: Nodes that have common parent element type in the > hierarchy. This is essential when using UnionExpr since subsequent filters > would require consistency in the element type of input nodes. No. A node set is any set of nodes, they do not have to share a parent and they don't need to be nodes of the same type or elements with the same element name. For example, "//H1 | //comment()" is a node set containing all H1 elements and all comments in the document. > > Node List: Could be a 'Node set' but not necessarily. This is > a context list of nodes that contain nodes of different types from arbitrary > levels (in the document order). A node list is a collection of nodes that has a defined order. The order is not necessarily document order. Example: from-ancestors(.) generates a node list containing all the ancestors of the current node in reverse document order from-ancestors(.)[position()<4] selects the first three nodes in that list, returning a new node list containing the parent, grandparent, and greatgrandparent of the current node, in that order (reverse document order) xsl:variable name="elders" expr="from-ancestors(.)[position()<4]" converts this node list to a node set (i.e. it loses the ordering information and potentially eliminates duplicates), so the value of elders is a node set. xsl:apply-templates select="$elders" (in the absence of an xsl:sort specification) sorts this node set into document order before applying the relevant template to each node in the sorted list: so the order of processing is greatgrandparent, grandparent, parent. Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Node Set and Node List differen, Norman Walsh | Thread | Can solve the N-queens - but can't , Oren Ben-Kiki |
RE: understanding trees, Kay Michael | Date | RE: Can solve the N-queens - but ca, Kay Michael |
Month |