Microsoft XML 2.5 SDK


 

XSL Pattern Methods

[This is preliminary documentation and subject to change.]

To apply a method to a particular context, append the exclamation point character (!) to the context term (the element or attribute name), followed by the method name.

The XSL Pattern syntax provides methods that fall into two general groups: Information Methods and Collection Methods. The information methods provide information about particular nodes, such as the node type, node name, its text, or other information. The collection methods return collections of all nodes of a particular type, such as all comment nodes, all processing instruction nodes, and all element nodes.

Method names are case sensitive. For example, the textnode method returns the text contained within a node, without any structure. (That is, it is the concatenation of all text nodes contained within an element and its descendants.)

Examples

Find all text children of author elements:

author/text()

Find all elements that have text node or CDATA node children:

*[text()]

Find all author elements containing text nodes whose value is "Bob":

author[textnode() = "Bob"]