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.

EDI to XML Mapping in Stylus Studio

Learn how to use Stylus Studio's EDI to XML mapping tools in Convert-to-XML, including loading an EDI file, inspecting application control codes, customizing XML output and other advanced EDI to XML mapping features.

Validating X12 Documents with XML Schemas

Either before or after transforming X12 EDI content, generated XML Schemas will make sure that we have all of the necessary components, our codes are all according to the standard codelists, and every little delimiter is in the right place.

XQuery Talk

Join the XQuery Talk mailing list for a practical discussion about XQuery. It's a place to work together to learn a new language, talk about problem solutions, discuss engines and implementations, chat about the latest XQuery news and more.

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.

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.