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

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

This rules out reading a binary file, which might contain bytes such as x00 that are not valid in XML.

XTDE1200

If the second argument to
unparsed-text()
is omitted the processor must be able to infer the encoding, or the encoding must be UTF-8

If the processor can't work out the encoding, then it will assume UTF-8, and if the file is not encoded in UTF-8 then it's quite likely that decoding will fail with this error.

XTDE1260

The first argument to
key()
must be a valid lexical QName whose prefix has been declared and which identifies a key declaration in the stylesheet

The value (even if computed at runtime, which is rare) must either be unprefixed or use a prefix that is declared at the point where the
key()
function is called, and it must match the
name
attribute of an

declaration.

XTDE1270

The node supplied in the third argument of
key()
, or the context node if omitted, must be a node in a tree that is rooted at a document node

To make life easier for implementors,
key()
can only be used to search within a complete document. You can search a subtree rooted at an element, as long as it is part of a complete document rooted at a document node.

XTDE1280

The third argument to
format-number()
must be a valid lexical QName whose prefix has been declared and which identifies a decimal format declaration in the stylesheet

That is, it must match the
name
attribute of an

declaration.

XTDE1310

The second argument to
format-number()
must be a valid picture string

For the rules, see the description of
format-number()
in Chapter 13.

XTDE1340

The second argument to
format-date/time()
must be a valid picture string

The rules are described under
format-dateTime()
in Chapter 13.

XTDE1350

The picture string used for
format-date/time()
must not refer to components that are not available in the given type of value

For example, you can't use
[MNn]
with
format-time()
, because a time does not have a month component.

XTDE1360

The
current()
function must not be used within an expression that is evaluated when there is no context item

Since
current()
refers to the value of the context item at the outermost level of the XPath expression, it's an error if there is no context item at that level.

XTDE1370

When
unparsed-entity-uri()
is evaluated there must be a context node, and it must be in a tree rooted at a document node

Unparsed entities can only occur in complete XML documents; this function searches the document in which the context node is to be found.

XTDE1380

When
unparsed-entity-public-id()
is evaluated there must be a context node, and it must be in a tree rooted at a document node

See XTDE1370.

XTDE1390

The first argument of
system-property()
must be a valid lexical QName and its prefix must be declared

The argument will usually be a string literal, and it will usually be a name in the XSLT namespace such as
xsl:vendor
. It doesn't have to be a prefixed name; you may be able to use a plain name to access operating system environment variables.

XTDE1400

The first argument of
function-available()
must be a valid lexical QName and its prefix must be declared

The name doesn't have to be prefixed; if it isn't, the default function namespace is assumed.

XTDE1425

When an extension function is called the supplied arguments must satisfy the rules for the extension function, the extension function must not report an error, and the result must be convertible to an XPath value

This is a catch-all for the things that can go wrong when you call an extension function.

XTDE1428

The first argument of
type-available()
must be a valid lexical QName and its prefix must be declared

The name doesn't have to be prefixed; in the absence of a prefix the value of
xpath-default-namespace
applies.

XTDE1440

The first argument of
element-available()
must be a valid lexical QName and its prefix must be declared

Typically, this will be a name either in the XSLT namespace, or in a namespace defined by the vendor for extensions.

XTDE1450

An unrecognized extension instruction with no
xsl:fallback
children was encountered

The processor knows that it is an extension instruction because its namespace was identified in
[xsl:]extension-element-prefixes
. But the processor doesn't know how to evaluate the instruction, and there is no fallback implementation.

XTDE1460

The
format
attribute of
xsl:result-document
must evaluate to a valid lexical QName, its prefix must be declared, and it must match the name of an output definition in the stylesheet

That is, it must match the
name
attribute of an

declaration (comparing the names as QNames).

XTDE1480

The
xsl:result-document
instruction must not be evaluated in temporary output state

This typically means that you called

while evaluating a variable or a function. This isn't allowed because producing a new output document is a kind of side effect.

XTDE1490

A transformation must not generate two result trees with the same URI

One output document would typically overwrite the other, and since order of execution is undefined, it's not clear which one would win. The processor might even try to write both at once, with fatal results.

XTDE1665

When a basic (non-schema-aware) processor is used, the input document must not contain a node with a type annotation other than
xs:untyped
or
xs:untypedAtomic
, or an atomic value of a type which basic XSLT does not allow

It's very likely that if your processor isn't schema-aware, then there's no way to create typed (validated) input documents, so this error condition will never arise. But it's there to cover the eventuality.

XTMM9000

The
xsl:message
instruction was evaluated with terminate=“yes”

This isn't really an error, just a code that the system can use when the stylesheet terminates voluntarily.

XTRE0270

An
xsl:strip-space
and
xsl:preserve-space
declaration define conflicting rules for the same element

The processor can report this as an error, or can use whichever declaration comes last in the stylesheet.

XTRE0540

There must not be two template rules that match the same node with the same mode, import precedence, and priority

It's best not to have two template rules that match the same node, but if it happens, the processor has a choice. It can report a fatal error, or it can choose the template that comes last in the stylesheet, either silently or with a warning. If you see this error, it's best to make your intentions clear by setting the
priority
attribute on both templates to indicate which is preferred.

XTRE0795

If the name of a constructed attribute is
xml:space
then the value must be
default
or
preserve.

The XML specification says that a value for
xml:space
other than these two is “erroneous”, but it's not clear whether such a document is well formed or not; some XML parsers accept it and some don't. XSLT processors are allowed to report an error if you try to write such a value, but they can ignore the error if they prefer.

XTRE1160

When a URI passed to
document()
contains a fragment identifier, the fragment identifier must be valid for the media type (which the processor must recognize) and must select a sequence of nodes

A fragment identifier is the part of a URI after the
#
sign. The interpretation of a fragment identifier depends on the media type (
=MIME
type) of the resource. For
application/xml
, the fragment is typically the value of an ID attribute, but this is only recognized if (a) the media type is known (usually from HTTP headers), and (b) ID attributes are notified by the XML parser.

Other books

Bermuda Heat by P.A. Brown
The Sleeping Beauty by Elizabeth Taylor
Assigned a Guardian by Emily Tilton
The Forever Girl by Alexander McCall Smith
T*Witches: Don’t Think Twice by H.B. Gilmour, Randi Reisfeld