XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (193 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
7.79Mb size Format: txt, pdf, ePub

Position


is an instruction. It is always used as part of a sequence constructor.

Attributes

Name
Value
Meaning
select
optional
XPath Expression
The expression is evaluated to produce the content of the message.
terminate
optional
Attribute value template returning
yes
or
no
The value
yes
indicates that processing is terminated after the message is output. The default is
no
.

Content

A sequence constructor. There is no requirement that this should only generate text nodes; it can produce any XML fragment. What happens to any markup, however, is not defined in the standard.

This means that writing

could cause an error, on the grounds that you are trying to output an attribute node when there is no element to attach it to. It's safer to atomize the attribute node explicitly by calling
data()
or
string()
.

Unlike other elements that allow a
select
attribute and a sequence constructor, in this case they are not mutually exclusive. The results of evaluating the
select
expression and the results of evaluating the sequence constructor are concatenated to form a single sequence.

Effect

The

instruction behaves in a similar way to

described on page 445; it uses the contained sequence constructor (in this case, with the results of evaluating any
select
expression added at the front) to construct a new document node, sends the constructed document to an implementation-defined destination, and returns an empty sequence.

Unlike

, the

element provides no direct control over the destination or format of the result. The intention is that it should be used to produce progress messages, errors and warnings, which are secondary to the purpose of the transformation.

If the
terminate
attribute is omitted, the value
no
is assumed.

The contents of the constructed document (which will often be a simple text node) are output where the user can be expected to see them. The XSLT specification does not actually say where it goes; this is implementation-dependent, and it might be determined by configuration options. The specification suggests an alert box on the screen and a log file as two possible destinations.

If the
terminate
attribute has the value
yes
, execution of the stylesheet is abandoned immediately. In this situation (as indeed after any runtime error) the content of any output files is undefined.

Other books

The Rainbow Maker's Tale by Mel Cusick-Jones
Falling by Tonya Shepard
Man of God by Diaz, Debra
Flawed Love: House of Obsidian by Bella Jewel, Lauren McKellar
Champions of the Apocalypse by Thomas, Michael G.
Deadtown by Holzner, Nancy
Weeding Out Trouble by Heather Webber