Click to return to the XML (Extensible Markup Language) home page    
Context Changing Operator...     Information Methods     XSL Pattern Syntax    
Web Workshop  |  XML (Extensible Markup Language)

XSL Pattern Methods


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"]


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.