Examples of XPath Expression Results

Table 54 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 54. XPath Expression Results

Content Management

Build Content Management systems with Stylus Studio's powerful XML publishing tools that enable you to unlock and re-use valuable content from your enterprise information repositories.

XMLSCHEMA-DEV Blog

XML Schema-DEV is an active community for XML Schema-releated development - join the discussion on XML Schema standards, tools, implementations and more. Bookmark this RSS or ATOM feed today!

Varying Record Layout to XML

Not every row in a text file has to have the same layout. Convert to XML has advanced pattern-recognition tools to route the data to where it belongs.

Single Source Publishing

Single source publishing is the ability to use one source of information for generating multiple types of output. Stylus Studio XML Publishing enables Single Source Publishing - publish PDF or HTML documents from Relational, XML or Legacy files.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member