|
Home > Online Product Documentation > Table of Contents > About the XPath Processor About the XPath Processor
The XML editor in Stylus Studio supports both the W3C XPath 1.0 Recommendation and the W3C XPath 2.0 Working Draft of November 2003. By default, Stylus Studio uses its XPath 1.0 processing engine. You can select the XPath 2.0 processing engine by clicking the
v.2 icon (
As an overview of the XPath processor, this section provides the following information: For additional information about XPath see http://www.w3.org/TR/xpath and http://www.w3.org/TR/xpath20 . Where You Can Specify Queries
When you use Stylus Studio, you specify queries as values of
You can also specify a query at the top of an XML document window. In the Query Output window, Stylus Studio displays the result of the query. About XPathXPath is a notation for retrieving information from a document. The information could be a set of nodes or derived values. XPath allows you to identify parts of an XML document. In addition, a subset of XPath allows you to test whether or not a node matches a particular pattern. XPath provides Boolean logic, filters, indexing into collections of nodes, and more.
XPath is declarative rather than procedural. You use a pattern modeled on directory notation to describe the types of nodes to look for. For example,
XPath provides a common syntax for features shared by Extensible Stylesheet Language Transformations (XSLT) and XQuery. XSLT is a language for transforming XML documents into XML, HTML, or text. XQuery builds on XPath and is a language for extracting information from XML documents. The basic syntax for XPath mimics the Uniform Resource Identifier (URI) directory navigation syntax. However, the syntax does not specify navigation through a physical file structure. The navigation is through elements in the XML tree. Benefits of XPathXPath is designed for XML documents. It provides a single syntax that you can use for queries, addressing, and patterns. XPath is concise, simple, and powerful. XPath has many benefits, as follows:
When you define a query, keep in mind that XML data can be represented as a tree. A tree is a hierarchical representation of XML data. The root node is the top of the tree. Each element, attribute, text string, comment, and processing instruction corresponds to one node in the tree. A tree also shows the relationships among the nodes. For more information on tree structure, see Tree Representation of a Sample XML Document. InternationalizationQueries can contain non-Latin characters. Restrictions on QueriesXPath is a language for selecting existing XML data; it does not perform manipulation (like sorting) or construction of different XML structures. To perform such operations, you need to use the language that is hosting XPath, XSLT or XQuery, for example. You cannot query non-XML data. If you query a document that does not contain XML-formatted data, Stylus Studio displays an error message that informs you that the queried text is not XML. |

Cart

