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."] 
               

            

DOM - The Document Object Model

The Document Object Model (DOM) is a cross-platform interface for parsing and manipulating XML. Learn how Stylus Studio supports DOM in our XML Pipeline and other XML parsing tools.

Join Us: Apply for a Job at Stylus Studio Today

Join our team of XML professionals and help us in our mission to create the most productive XML tools and components on the planet. Apply today!

Internet & eBusiness

Internet & eBusiness

Web Service Data Mapping

Stylus Studio makes it possible for you to use Web services as live XML data sources for XML mapping projects.

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.