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

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

Context Size (XPath)

When a
sequence
of
items
is processed in an
expression
of the form
E1/E2
or
E1[E2]
, or by an

or

instruction
in XSLT, each item in the sequence in turn becomes the
context item
, and the context size identifies the number of items in the sequence being processed. The context size determines the value of the
last()
function.

Current Mode (XSLT)

When a
template rule
is invoked, the
mode
used in the

instruction
that invoked it is called the current mode. A further call of

within this
template rule
can specify
mode=“#current”
to continue processing in the current mode.

Current Template Rule (XSLT)

When

selects a
template rule
to process a particular
node
, that template rule becomes the current template rule. It remains the current template rule through calls of

, but not through calls of

. The current template rule is used only in deciding which template rule to invoke when

is called.

Data Model (XPath)

The
XDM
data model is a description of the kinds of objects that can be manipulated by XPath
expressions
, and their properties and relationships. Examples of such objects are
sequences
,
items
,
atomic values
,
nodes
, and
trees
. (Sometimes the term
data model
is used loosely to refer to a specific object, such as the tree representation of a particular document).

Declaration (XSLT)

A declaration is a top-level
element
in a
stylesheet module
(that is, a
child
element of the

element), other than a user-defined data element, which is ignored by the XSLT processor.

Default Namespace Declaration (XML)

This takes the form of an XML
attribute
xmlns=“uri”
. It declares that within its scope, an
element
name with no explicit prefix will be associated with a particular
namespace URI
. The default namespace is used only for element names; other objects with no
prefix
(for example, attributes) have a null namespace URI.

Descendant Axis (XPath)

The descendant
axis
selects all the
children
of the
context node
, their children, and so on, in
document order
. This is a
forwards axis
.

Descendant-or-Self Axis (XPath)

The descendant-or-self
axis
selects the
context node
followed by all the
nodes
on the
descendant axis
. This is a
forwards axis
.

Document (XML)

A parsed entity that conforms to the XML syntax for a
Document
is said to be a
well-formed document
; a document that also obeys the rules in its
document type definition
is said to be
valid
. In XSLT and XPath the term
document
is often used to refer to the
tree
representation of a document, that is, a
document node
together with all the
nodes
that have this document node as an
ancestor
.

Document Element (XML)

The outermost
element
of a
document
, the one that contains all other elements. The XML standard also refers to this as the root element, but it must not be confused with the
root node
in the XPath tree model: the
root node
is usually the
document node
that is the
parent
of the document element, which represents the document itself.

Document Node (XDM)

If the
tree
represents a well-formed XML
document
, the
root node
will be a
document node
with exactly one
element node
as a child, representing the
document element
, and no
text nodes
as children. In other cases, it may have zero or more
element node
children, and zero or more
text node
children: I refer to such a document as being
well balanced
. In both cases, the
root node
may also have
comment nodes
and
processing instruction nodes
as children.

Document Order (XDM)

The
nodes
in a
sequence
can always be sorted into document order. For
elements
from the same
document
, document order is the same as the order of the start
tags
in the original source. In terms of the tree structure, a node is ordered after its
preceding siblings
, and these are ordered after their
parent
node. The ordering of
attribute
and
namespace nodes
, and of nodes from different source
documents
, is only partially defined.

Document Type Definition (DTD) (Xml)

The definition of the structure of an XML
document
, or a collection of XML
documents
. May be split into an external subset, held in a separate file, and an internal subset, embedded within the document itself.

Dynamic Context (XPath)

The dynamic context of an XPath
expression
is the total collection of information available to the XPath engine at evaluation time. This includes the
context item
,
context position
, and
context size
, the values of all
variables
, and the contents of all
documents
that can be accessed by their
URI
, using functions such as
doc()
and
document()
.

Dynamic Error (XPath)

A dynamic error is an error detected during the evaluation phase, as distinct from a
static error
, which is detected at compile time. Technically,
type errors
(which may be detected either at compile time or at runtime) form a separate third category.Dynamic errors defined in XSLT are classified as being either recoverable or nonrecoverable. In the case of recoverable errors, the processor is allowed either to report the error or to recover in a defined way and continue processing, or both.

Effective Boolean Value (XPath)

The effective boolean value of an
expression
is used when the expression appears in a context where a choice needs to be made; for example, the condition in an XPath conditional
expression
or an XSLT

instruction
. The effective boolean value of a
sequence
is
false
if the sequence is empty, or if it contains a singleton
atomic value
that is the
boolean
false
, a zero-length string, a number equal to zero, or
NaN
; in most other cases, the effective boolean value is
true
. For some sequences (for example a sequence of more than one atomic value, or a single date), there is no effective boolean value, and using such an expression in a boolean context causes an error.

Effective Value (XSLT)

The effective value of an
attribute
in an XSLT
stylesheet
is the value after expanding any
attribute value template
; for example, given the instruction
terminate=“{$term}”/>
, the effective value of the
terminate
attribute is the value of the
$term
variable.

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

Other books

Evil Breeding by Susan Conant
Murder at the PTA by Alden, Laura
Tangled Web by Cathy Gillen Thacker
The Winner's Kiss by Marie Rutkoski
Mistletoe & Michaelmas by Rose Gordon
The Fall of Rome by Beth Ciotta