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.

XSLT Profiler

Stylus Studio's XSL and XSLT profiler allows you to create detailed XSLT performance metrics profiles of any stylesheet in a processor-independent way.

XML Schema-Aware Queries and Stylesheets

Learn how to simplify XSLT and XQuery applications using Schema Aware XSLT and XQuery processing technologies.

Data Integration - DataDirect XML Converters

DataDirect XML Converters are high-performance Java components which provide bi-directional, programmatic access to virtually any data source as XML.

DataDirect XML Converters Video Demonstration

DataDirect XML Converters are Java and .NET components that enable access to any data (flat files, EDI) from your application code. Learn how to deploy XML applications today.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member