Finding Nodes Relative to the Last Node in a Set

To obtain nodes relative to the last node in the set, use the position() and last() functions with arithmetic. For example, the following queries both obtain the last author element in the current context:

author [position() = last()]
               
author [last()]
               

            

The following queries both return the next-to-last author element:

author [position() = last() - 1]
               
author [last() - 1]
               

            

For information about position(), see Determining the Position Number of a Node. For information about last(), see Determining the Context Size.

An Introduction to XQuery Development

An Introduction to XQuery demonstrates how easy it is to use Stylus Studio's many tools for editing, testing and deploying XQuery applications. Learn how to write your first XQuery application in just minutes by watching this online tutorial.

Using DTD in Microsoft Applications

Learn how to integrate DTD's into your Microsoft applications using MSXML or System.XML DTD processing components.

XSL-List

The XSL-List forum is a valuable learning resource for the Extensible Stylesheet Language (XSL), covering the XSL specification, XSL processor implementations, and XSL user questions. Get this free XSL resource delivered to your inbox today.

Configuring the Java Runtime Engine or Java Development Kit

This page identifies the Stylus Studio modules that require Java runtime and Java compiler components, where you can download these Java components, and how to force Stylus Studio to detect new or changed Java components.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member