Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
The XSL pattern-matching syntax supports collection methods to access the various types of nodes in a document. Any of these collections can be constrained and indexed. The collections return the set of children of the reference node meeting the particular restriction.
Collection Methods
ancestor Finds the nearest ancestor matching the pattern. It returns either a single element result or null. attribute Returns the collection of all attribute nodes. If the optional text parameter is provided, it returns only attributes matching that particular name. comment Returns the collection of comment nodes. element Returns the collection of all element nodes. If the optional text parameter is provided, it returns only element children matching that particular name. node Returns the collection of all non-attribute nodes. pi Returns the collection of processor instruction nodes for this document. textnode Returns the collection of text nodes for this document.
Remarks
Note that the XML Document Object Model (DOM) defines a document object that contains comments, processing instructions, and declarations, as well as what is termed the "root element." The XML working drafts use the term "document entity" for the root of the DOM tree—the document object—instead of the "root element." This allows access to nodes at the document entity level, such as comments.
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.