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

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

A
function
defined by a product vendor, a user, or a third party, which can be called from within an XPath
expression
. The XSLT specification defines how extension functions are called but not how they are implemented.

Extension Instruction (XSLT)

An
element
within a
sequence constructor
that is defined by a product vendor, a user, or a third party but otherwise behaves like an XSLT
instruction
. The XSLT specification defines how extension instructions are evaluated but not how they are implemented. In XSLT 1.0, extension instructions were referred to as extension elements.

Facet (Schema)

A facet is a constraint placed on the values of a
simple type
in the
schema
. For example, the
pattern
facet (not to be confused with XSLT
patterns
) constrains the value to match a given
regular expression
, while the
maxInclusive
facet defines the largest permitted value.

Final Result Tree (XSLT)

A
tree
that is constructed by a
stylesheet
and acts as an output of the transformation (as distinct from a
temporary tree
that can be further processed by the transformation).

Following Axis (XPath)

The following
axis
selects all the
nodes
that follow the
context node
in
document order
with the exception of
attribute
and
namespace
nodes, and the node's own
descendants
. This is a
forwards axis
.

Following Sibling Axis (XPath)

The following sibling
axis
selects all the
nodes
that follow the
context node
in
document order
and that share the same
parent
node. This is a
forwards axis
.

Forwards Axis (XPath)

An
axis
containing a
sequence
of
nodes
that follow the
context node
in
document order
. Within a
predicate
of an axis
step
that uses a forwards axis (for example,
following-sibling::x[3]
), position numbers count the nodes in
document order
.

Function (XPath)

A procedure that can be called from within an XPath
expression
; it takes arguments and returns a result. Functions cannot be defined using XPath, only invoked from XPath. A function is either a core function defined in the XPath or XSLT recommendations, or a
stylesheet function
defined using an

declaration in XSLT, or an
extension function
provided by the vendor or the user. Functions may also be defined using XQuery. A function has a name (which is a
QName
), a signature defining the types expected for its arguments and the return type, and an implementation.

Global Variable (XSLT)

A
variable
defined in a top-level

element. Global variables are available anywhere in the
stylesheet
(including in other
stylesheet modules
), unless masked by a
local variable
or
range variable
of the same name, or a global variable of the same name and higher
import precedence
.

ID (XML)

An
attribute
of type ID has a value that is unique within the
document
(that is, different from any other ID attribute). It is an ID by virtue of being declared as such in the
DTD
or
Schema
, or by being named
xml:id
. It is guaranteed to be unique only if the document is
valid
(XSLT is not constrained to operate only on valid documents).
Elements
can be accessed using their ID by means of the
id()
function.

Import Precedence (XSLT)

A
stylesheet module
that is loaded using

has lower import precedence than the
stylesheet module
doing the importing. The import precedence affects all the top-level
declarations
in that stylesheet, and is used when deciding which top-level elements to use. For example, if two
global variables
have the same name, the one with higher import precedence is used.

Initial Template (XSLT)

The first
template
to be evaluated when a
stylesheet
is activated. This may be defined by nominating a
named template
from the invoking API, or it may be selected by applying
template rules
to an initial node supplied in the API (typically, by default, the
document node
of the principal source document).

In-Scope Namespaces (XPath)

Any
element node
has a set of
namespace declarations
that are in scope for the element: these are represented by the
namespace nodes
for that element. An XPath
expression
also has a set of in-scope namespaces in its
static context
. For XPath expressions in an XSLT
stylesheet module
, the in-scope namespaces for the expression are the namespaces that are in-scope for the
element
in the
stylesheet
that contains the XPath expression, augmented with the namespace defined in the
[xsl:]xpath-default-namespace
attribute if present. In non-XSLT contexts, it is up to the host environment to define how the
static context
for an XPath expression is established.

Instruction (XSLT)

One of a number of XSLT
elements
that is permitted to appear directly within a
sequence constructor
; for example,

,

, and

. Not all XSLT elements are instructions; for example

and

are not; this is because these can appear in a defined context only.

Item (XDM)

An item is either an
atomic value
or a
node
.

Item Type (XPath)

An item type describes the type allowed for
items
within a
sequence
. This is either
item()
, which allows any item; an
atomic type
; or a node type. Node types define the kind of node (for example
element
,
attribute
, or
comment
) plus, optionally, constraints on the name of the node and on its
type annotation
, which will always be a
schema type
.

Lexical QName (XPath)

A
QName
written in its lexical form: either a simple unprefixed name or a construct of the form
prefix:local-name
. See also
expanded QName
.

List Type (Schema)

A
simple type
that allows a space-separated sequence of values to be written. For example, the type
xs:NMTOKENS
permits the value
“red green blue”
. When an
element
or
attribute
is annotated with a list type, its
typed value
in XPath is a
sequence
containing the individual
items
.

Literal Result Element (XSLT)

A literal result element is an
element
appearing within a
sequence constructor
in a
stylesheet
that is not an XSLT
instruction
or an
extension instruction
. When the sequence constructor is evaluated a new
element node
is added to the result sequence, and its content (which is also a
sequence constructor
) is evaluated to form the content of the newly constructed element.

Local Variable (XSLT)

A
variable
defined within a
sequence constructor
. A local variable is accessible only from the
following siblings
of the

element that defines the variable, and from their
descendants
. This is analogous to the normal rule in block-structured programming languages.

Mode (XSLT)

Modes partition the set of
template rules
in a
stylesheet
, so that the same
nodes
can be processed more than once using different rules each time. The mode named on the call of

must match the mode named on the

element that is invoked.

Named Template (XSLT)

An

element in the
stylesheet
with a
name
attribute. A named template may be invoked using an

instruction
.

Namespace (XML Namespaces)

A named collection of names. The namespace is named using a
URI
(or in the 1.1 specification, an IRI), which is intended to be formed in such a way as to ensure global uniqueness, but which, in practice, may be almost any string. Within a particular region of a
document
, a namespace is also identified by a shorthand name called a
prefix
; different prefixes can be used to refer to the same namespace in different
documents
or even within the same document. A name (of an
element
or
attribute
in XML, and of a
variable
,
template
,
function
,
mode
, and so on in XSLT) belongs to a specific namespace, and two names can be considered equivalent only if they belong to the same namespace.

Other books

Fireworks in the Rain by Steven Brust
The One Safe Place by Kathleen O'Brien
Convicted by Megan Hart
Breathe Me (A 'Me' Novel) by Williams, Jeri
Kissing Mr. Right by Michelle Major
Rocannon's World by Ursula K. LeGuin
If Only by Lisa M. Owens
The Dead Live On by Cooper Brown, Julie