Expressions

The complete expression language includes the locations paths and patterns described above, but it also contains a wider set of features built around the use of functions to manipulate and analyze data items of various types, and operators to compare objects and perform various calculations.

Where expressions are allowed

XSLT allows full expressions to be used in a number of places. They are used in the Select attribute of the Copy Of element, Parameter element, Sort element (so long as it returns a string), Variable element, Value Of element (so long as it returns a string), and the With Parameter element:

<copy-of select="expression">...</copy-of>

<param select="expression">...</param>

<sort select="expression">...</sort>

<variable select="expression">...</variable>

<with-param select="expression">...</with-param>

They can also be used with the Test attribute of the If element (so long as it returns a boolean value) and the Value attribute of the Number element (so long as it returns a numeric value):

<if test="expression">...</if>

<with-param value="expression">...</with-param>

Expressions may be used in the predicate filters within patterns:

<template match="...test[expression]...">...</template>

Finally, expressions may be used in attribute value templates:

<IMG SRC="{expression}.gif" />

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset