|
Home > Online Product Documentation > Table of Contents > Querying XML Documents Using XPath Querying XML Documents Using XPathIn each view of an XML document, you can query the document to obtain a subset of the information in that document. You can query stylesheets and XML Schema documents, but you cannot query DTD schema documents because they are not XML. This section discusses the following topics: Steps for Querying a DocumentTo query a document:
1. Open the document you want to query.
2. In the document window tool bar, click in the query field. This field contains either a prompt to create a new query, or it contains a query you ran previously. For information about how to write a query, see
Chapter 9Writing XPath Expressions.
Alternative: Press F6.
3. Press Enter to run the query or click
Refresh Query
If a document is part of a Stylus Studio project, Stylus Studio saves the queries you specify. If you save, close, and reopen a document, the queries you already specified are still defined. In the document window, click the down arrow to the right of the query field to display the defined queries.
Stylus Studio assigns a number, beginning with
After you make some modifications to your document, you might want to run a query that you already ran. Display the query in the field in the document tool bar and click Refresh Query. Displaying Query ResultsHow Stylus Studio displays the result of a query depends on the type of result.
A tab at the bottom of the Query Output window displays the number that Stylus Studio assigned to your query. After you run multiple queries on the same document, there is a tab for each query that you run. This allows you to view the results of the different queries as needed. Saving Query ResultsAfter you execute a query, Stylus Studio displays the results in the Query Output window. To save query results:
1. In the
Query Output window, click
Save Result
2. In the
Save As dialog box that appears, navigate to the directory that you want to contain the query result.
3. In the
File name: field, type the name for the file that will contain the query result.
4. Click
Save.
To add a query result file to a project, see Adding Files to Projects. |

Cart

