Determining the Context Size

To obtain the number of nodes in the current context, call the last() function. The format is

number last() 
               

            

The last() function returns a number equal to the context size of the expression evaluation context. Essentially, the last() function returns the position number of the last node in document order for the current context. For example, the following query returns all books if there are three or more of them. There are three book elements in the current context. Consequently, this query returns three book elements.

/bookstore/book[last() >= 3]
               

            

Manufacturing

Manufacturing

XSV - The XML Schema Validator

XSV is the official reference implementation for the XML Schema language and Stylus Studio is the only XML IDE to provide seamless integration with XSV - the W3C XML Schema Validator. Download Stylus Studio and XSV today.

Database-to-XML Mapping

Stylus Studio features several database-to-XML mapping tools that allow you to easily query a relational database using SQL/XML or SQL and render the results as XML. Stylus Studio also supports the world's first and only visual SQL/XML Editor!

XML-DEV Blog

Join the XML Development discussion at XML-Dev - the hottest place to talk about XML technologies, trends, systems architecture and all the latest buzz. Bookmark this RSS and ATOM feed now!

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member