Working with Expressions

Most readers are familiar with expressions. 1+1=2, a2 + b2=c2, and if (a>b) then x are all examples of simple expressions. XSL supports expressions of surprising sophistication and power. In fact, XSLT derives much of its power from its expression language. Expressions allow developers to do several things, chief of which are

  • Selecting nodes to be further processed

  • Specifying conditions for processing nodes

  • Generating output text

There are five types of expressions:

  • Node Sets— Expressions that act on node sets. Node sets are just that, unordered collections of nodes generated by applying <xsl:template match="..."> and <xsl:apply-template select="...""> rules. We've been working with node sets all along but haven't known ...

Get XML Development with Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.