Examples of Specifying Positions

The following query finds the first and fourth author elements:

author [(position() = 4) or (position() = 1)]
               

            

The next query finds the first, the third through the fifth, and the last author elements:

author [(position() = 1) or 
               

              
(position() >= 3 and position() <= 5) or 
                   
(position() = last())]
                   

                

The XPath processor removes duplicate values. For the previous query, if there are only five elements in the collection, the query returns only one copy of the fifth element.

The next example finds all author elements in which the first degree is a Ph.D.:

author[degree[1] = "Ph.D."] 
               

            

DB2

IBM DB2 is a database management system for powering business applications. Learn how to build XML solutions on DB2 using Stylus Studio's DB2 tools.

The XML Primer: Editing and Validating XML in Stylus Studio

The XML primer demonstrates editing and validating XML in Stylus Studio demonstrates XML editing tools and utilities to simplify working with XML documents. Learn how to automate XML editing operations and troubleshoot XML documents today!

EII - Enterprise Information Integration

Learn how to build EII applications with Stylus Studio's powerful Enterprise Information Integration Tools.

Using OASIS XML Catalogs in Stylus Studio

Learn about Stylus Studio's XML catalog support and how to work with XML catalogs in your Stylus Studio XML projects.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member