Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Specifies the text contained within the element.
Syntax
text()
Remarks
This method concatenates the text of all the element's descendants. It does not include the tag names or any attribute values, comment values, and so on.
The method optionally normalizes white space along the way. White space will be preserved for a node if the node has the xml:space attribute set to "preserve", or if the nearest ancestor with the xml:space attribute has the attribute set to "preserve". When white space is normalized, it is normalized across the entire string. Spaces are used to separate the text between nodes. When entity references are used in a document, spacing is not inserted around the entity references when they are expanded.
Examples
Find the authors whose last name is "Bob":
author[last-name!text() = "Bob"]
Note this is equivalent to:
author[last-name = "Bob"].
Find the authors with value "Matthew Bob":
author[text() = "Matthew Bob"]
author[. = "Matthew Bob"]
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.