Working with XPath Queries

When you display the XPath Query Editor, an empty query is created for you. The query name, Query1, is displayed on a tab in the XPath Query Editor window.You can start typing the XPath expression on the first line in the editing pane; use the Enter key to move the cursor to a new line.

Tip

 

Line numbers are displayed in the editing pane if you have enabled them for XML documents. Click Tools > Options > General > Editor General to change this setting.

You can create up to sixty-four queries for a single document; each is given the name Query n, where n is a unique number incremented by one. You cannot name queries.

Queries are saved with the project. Changes you make - either to query expressions, or creating and deleting queries - are saved when you save the project, and not the document.

Executing the Query

Stylus Studio executes XPath query expressions based on the cursor's current position in the document, regardless of which editor is currently active.

To execute the query:
  • Click the Execute button on the XPath Query Editor tool bar ( ).

Stylus Studio processes the query and displays the result in the results pane.

Alternatives:

  • Press F5.

or

  • Right-click the query panel in the XPath Query Editor and select Execute Query from the short cut menu.

Creating a New Query

To create a new query:
  • Click the New XPath Query button on the XPath Query Editor tool bar ( ).

A new tab appears in the XPath Query Editor.

Alternative:

  • Right-click the query panel in the XPath Query Editor and select New XPath Query from the short cut menu.

Deleting a Query

To delete a query:
  • Click the Delete button on the XPath Query Editor tool bar ( ).

The tab associated with the query is removed from the XPath Query Editor. The query itself is deleted when you save the project.

Alternative:

  • Right-click the query panel in the XPath Query Editor and select New XPath Query from the short cut menu.

DOM - The Document Object Model

The Document Object Model (DOM) is a cross-platform interface for parsing and manipulating XML. Learn how Stylus Studio supports DOM in our XML Pipeline and other XML parsing tools.

Forest & Paper Products

Many forest & paper product companies realize the best XML suite doesn't have "pay per" features. That's why these top forest & paper product companies choose Stylus Studio 2006 to get the world's best XML features all in one bundle!

Saxon XSLT Processor

Stylus Studio® has partnered with Saxonica, a leading provider of Java-based XSLT and XQuery processing components to offer a robust XSLT 1.0 and 2.0 development environment, featuring development and deployment using the Saxon XSLT processor.

HTML Tidy

HTML Tidy is a program for turning HTML into something that can be parsed as XML, unlocking their data for use in XSLT and XQuery programs. Learn how to use HTML Tidy in Stylus Studio now.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member