Determining the Number of Nodes in a Collection

To obtain the number of nodes in a node set, call the count() function. The format is

number count(node-set) 
               

            

The count() function returns the number of nodes in the specified set. For example, the following query finds all authors who have more than ten publications:

//author[count(publications) > 10] 
               

            

To obtain the number of nodes in the current context, call the last() function, described in the next section.

Developer Resource Center: Learn XML and Stylus Studio

Learning XML is easy with Stylus Studio. Check out our free XML tutorials, XML whitepapers, online video demonstrations, XML examples and XML references and more.

XML-DEV Discussion Forum

XML-DEV is a leading technical forum for XML discussion and a valuable free XML learning resource. Subscribe to the XML-DEV email discussion forum today to help further your XML education.

JSP Editor

Edit and Validate JSP 1.2 and JSP 2.0 documents. Includes JSP syntax coloring, JSP code completion and more.

Writing Custom XML Adapters

There are cases where the input format is too complicated for Convert to XML, or both reading and writing of the file format is needed. This section will take you through the process of writing a medium-sized adapter in Java.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member