About Node Positions

The node positions for a node set start with 1. Evaluation of the position number is always based on document order. For example, the following query returns the first author element in the current context:

author[1] 
               

            

The next query finds the author elements (in the current context) that contain a first-name element. The query returns the third such author element.

(author[first-name])[position()=3] 
               

            

When you specify an integer in brackets, it is equivalent to calling the position() function. For example, the following queries both return the third y child element of each x child element in the current context:

x/y[3]
               
x/y[position()=3]
               

            

Tip: If you do not know the position of the node you want, a call to the position() function might help you. See Determining the Position Number of a Node.

The return value of the position() function depends on the specified axis. For example, suppose the axis is one of the reverse axes, such as preceding, ancestor, or preceding-sibling. The position() function returns the nth one in reverse document order that falls in the specified axis.

Java XML Parser

Stylus Studio's support for Java XML Parser is able to Validate XML Using any Java XML Parser, Edit, Debug, Profile and Map XSLT using any Java XSLT Processor, Create PDF files Using Apache FOP, hand have Support for Microsoft XML Parsers as well.

XML Document Wizards

Stylus Studio XML Document Wizards help you easily convert EDI, flat files, and other document formats to industry-standard XML.

Retail Companies That Use Stylus Studio

Stores and XML data can get very crowded. That's why retail companies use Stylus Studio to simplify their data. With the power of Stylus Studio these top retail companies are at the front of the line when it comes to XML!

FLWOR - An Introduction to the XQuery FLWOR Expression

An XQuery FLWOR Tutorial, covering an introduction to the main constructs of the XQuery FLWOR expression, including: For, Let, Where, Order By, and Return. Written by the W3C's Dr. Michael Kay.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member