Specifying Children or Descendants of Parent Nodes

Sometimes you want a query to return information about a sibling of the context node. One way to obtain a sibling is to define a query that navigates up to the parent and then down to the sibling.

For example, suppose the context node is the first author element. You want to find out the title associated with this author. The following query returns the associated title element:

../title
               

            

The double dot ( ..) at the beginning of the query instructs the XPath processor to select the parent of the context node. This query returns the title elements that are children of the first book element, which is the parent of the first author element. In the bookstore.xml document, there is only one such title element.

Now suppose that the context node is still the first author element and you want to obtain the style attribute for the book that contains this author. The following query does this:

../@style
               

            

The double dot notation need not appear at the beginning of a query. It can appear anywhere in a query string, just like the dot notation.

Hotels, Casinos & Resorts That Use Stylus Studio

What's more romantic than a vacation for two and the world's best XML IDE at your finger tips? Nothing, that's why these hotels, casinos, & resorts are using Stylus Studio to help you get on your dream vacation.

XML Schema Validation

Validate XML using XML Schema with MSXML, XERCES, XSV, SYSTEM.XML, & other XSD Validators. Stylus Studio's XML Schema-Aware XML Editing makes XML Schema Validation a snap!

Improving XSLT and XQuery Performance with Stylus Studio

This online video demonstration covers XQuery and XSLT performance tuning using the Stylus Studio XSLT profiler and the XQuery profiler.

EDIFACT Reference

The EDIFACT Reference is a free developer resource providing the most in-depth information on EDIFACT constructs and data models.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member