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]
               

            

XML Document Wizards

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

XML Reports

Build beautiful XML reports from Relational, XML and Legacy Data. You XML report can be rendered in PDF or HTML using XSLT, XQuery or XSL:FO.

Convert to XML

Convert to XML is a powerful data integration tool enabling you to convert any legacy data format (EDI, EDIFACT, x12, Binary, HTML, TSV, CSV, etc.) to XML using an intuitive, visual user interface.

Television

Television

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member