|
Home > Online Product Documentation > Table of Contents > Handling Strings and Text Handling Strings and TextThis section includes the following topics: Searching for StringsThis section provides information about searching for strings. This section discusses the following topics: Finding Identical StringsIn a document, you can search for text that is an exact match with what you specify in your query. For example, consider the following query:
This query finds all
The same query does not return elements like these:
The XPath processor does not return the first
Searches are case sensitive. A search for
Finding Strings That Contain Strings You Specify
To obtain elements that contain a particular string, call the
The
When the first argument is a node list, the XPath processor tests only the string value of the node in the node list that is first in document order. Any subsequent nodes are ignored. Finding Substrings That Appear Before Strings You Specify
To obtain a substring that appears before a string you specify, call the
The
Finding Substrings That Appear After Strings You Specify
To obtain a substring that appears after a string you specify, call the
The
Finding Substrings by Position
To obtain a substring that is in a particular position within its string, call the
The
If you do not specify the third argument, the
More precisely, each character in the string is considered to have a numeric position. The position of the first character is 1. The position of the second character is 2, and so on. The returned substring contains those characters for which the position of the character is greater than or equal to the rounded second argument and, if the third argument is specified, less than the sum of the value of the second and third arguments. The comparisons and addition used for the preceding follow the standard IEEE 754 rules. The XPath processor rounds the second and third arguments as if by a call to the
Manipulating StringsAfter you obtain a string, you might want to manipulate it and use the result in the query. This section describes functions that allow you to do this. It discusses the following topics: Concatenating Strings
To concatenate two or more strings, call the
The
Determining the Number of Characters in a String
To obtain the number of characters in a string, call the
The
Normalizing Strings
To strip leading and trailing white space from a string, call the
The
If there are consecutive internal spaces, the
Replacing Characters in Strings with Characters You Specify
To replace characters in a string with other characters, call the
The
Execution of this function returns
Execution of this function returns
If a character occurs more than once in the second argument string, the first occurrence determines the replacement character. If the third argument string is longer than the second argument string, the XPath processor ignores the excess characters. Converting Objects to Strings
In some situations, you might want to force a string comparison. The XPath processor performs a string comparison only when the operands are neither Boolean nor numeric values. If an operand is numeric or Boolean, call the
The
Node Sets
When the
Numbers
The
Boolean Values
The
Finding Strings That Start with a Particular String
To determine if a string starts with a particular string, specify the
This function returns
Obtaining the Text Contained in a Node
You can use the
Replace pathExpression with the path of the node or nodes that contain the text you want. This can be a rooted path or a relative path. It need not be a single node. If you do not explicitly specify the
The XPath processor obtains the text contained in each
For additional information about the
|
XML Project
Stylus Studio's Project Window is an intuitive, visual feature for organizing files belonging to a project. It supports different file-type icons and nested folders; many helpful options are available from the context menu.
XML Syntax Help - Intelligent XML Editing
Stylus Studio's XML Editors feature Intelligent XML Schema/DTD-Aware Code Sensing and context sensitive XML code auto-completion. Simplify XML editing with Stylus Studio today.
WSDL Editor
WSDL Editor featuring a graphical WSDL viewer, syntax help, Java Web Service code generation and more. Simplify Web Services development with Stylus Studio's Web Service Description Language (WSDL) Editor today!
Government Agencies That Use Stylus Studio
Government agencies all around the nation are pledging their allegiance to Stylus Studio. Come see which government agencies are using the only XML IDE by the people and for the people.