Examples of XPath Expression Results

Table 84 provides examples of XPath expression results:

Expression
Result

              /a
               

            
Returns the document element of the document if it is an a element

              /a/b
               

            
Returns all b elements that are immediate children of the document element, which is the a element

              //a
               

            
Returns all a elements in the document

              //a/b
               

            
Returns all b elements that are immediate children of a elements that are anywhere in the document

              a or ./a
               

            
Returns all a elements that are immediate children of the context node

              a/b
               

            
Returns all b elements that are immediate children of a elements that are immediate children of the context node

              a//b
               

            
Returns all b elements that descend from a elements that are immediate children of the context node

              .//a
               

            
Returns all a elements in the document tree branch that starts with the context node

              ../a
               

            
Returns all a elements in the document tree branch that are children of the parent node of the context node.
Table 84. XPath Expression Results

Learn SQL/XML

Learn how to access and update relational databases using industry-standard SQL/XML technologies along with Stylus Studio's DB-to-XML editor and File Explorer technologies.

Xerces - Parsing and Validating XML with the Apache Xerces Parser

The Xerces Parser supports the XML 1.0 recommendation and W3C's XML Schema recommendation version 1.0, DOM and SAX. Learn how easy it is to use Apache Xerces directly in Stylus Studio to parse and validate XML with ease.

OASIS Catalog Support

Stylus Studio's features for working with OASIS catalogs allow you to incorporate any vendor's catalog - or one of your own - in your XML, making writing correct and robust XML easier than ever.

DTD Parser

Learn about the powerful DTD parser technologies that are supported in Stylus Studio's DTD tools, including DOM and SAX based DTD parsing components.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member