|
Home > Online Product Documentation > Table of Contents > Sample Data for Examples and Testing Sample Data for Examples and TestingThe best way to learn how to query data is to practice using queries. To prepare you for testing queries, this section provides a review of the basic structure of an XML document. An understanding of this structure is crucial to defining queries that return the data you want. Following the review, this section includes the XML data on which the query examples operate. The last part of this section provides instructions for running queries on sample data.
The topics in this section include About XML Document StructureThe XPath processor operates on a tree representation of XML data that looks like the following figure:
The root node has no actual text associated with it. You can think of the file name as the root node. A document can include zero or more comments and zero or more processing instructions. A document element is required, and there can be only one. The document element contains all elements in the document. For example:
In the preceding figure,
A Sample XML Document
The examples in this section are based on the following XML data. This data is in the
Tree Representation of a Sample XML Document
When you query a document, it can be helpful to think of a tree representation of your data. A tree that represents the
Steps for Trying the Sample Queries
To try the queries in this section, or any other queries you want to run on the
1. In Stylus Studio, open
bookstore.xml. You can find it in the
examples directory of your installation directory.
2. At the top of the window that contains
bookstore.xml, highlight
<Type a new query>.
3. Type a query. For example: /bookstore/book/author.
4. Press Enter or click
Refresh Query
Stylus Studio displays the results in the Query Output window. |

Cart


