This appendix provides a summary of error conditions that a processor may signal. This list includes all error codes defined in this specification, but this is not an exhaustive list of all errors that can occur. Implementations must signal errors using these error codes, and applications can test for these codes; however, when more than one rule in the specification is violated, different processors will not necessarily signal the same error code. Implementations are not required to signal errors using the descriptive text used here.
Note:
The appendix is non-normative because the same information is given normatively elsewhere.
Static errors
It is a static error if an XSLT-defined element is used in a context where it is not permitted, if a required attribute is omitted, or if the content of the element does not correspond to the content that is allowed for the element.
It is a static error if an attribute (other than an attribute written using curly brackets in a position where an attribute value template is permitted) contains a value that is not one of the permitted values for that attribute.
It is a static error to use a
reserved namespace in the
name of a named template, a
mode, an attribute set, a key, a
decimal-format, a variable or parameter, a stylesheet
function, a named output
definition, an accumulator, or a character map; except that the name
xsl:initial-template
is permitted as a template
name.
It is a static error to use a reserved namespace
in the name of any extension function or extension instruction,
other than a function or instruction defined in this specification or in a normatively
referenced specification. It is a static error to use a prefix bound
to a reserved namespace in the [xsl:]extension-element-prefixes
attribute.
It is a static error for an element from the XSLT namespace to have an attribute whose namespace is either null (that is, an attribute with an unprefixed name) or the XSLT namespace, other than attributes defined for the element in this document.
The value of the version
attribute must be a number:
specifically, it must be a valid instance of the type
xs:decimal
as defined in [XML Schema Part 2].
An xsl:stylesheet
, xsl:transform
,
or xsl:package
element must not have any
text node children.
It is a static error if the value
of an [xsl:]default-collation
attribute, after resolving
against the base URI, contains no URI that the implementation recognizes as
a collation URI.
It is a static error if an
xsl:stylesheet
, xsl:transform
,
or xsl:package
element has a child element whose name
has a null namespace URI.
A literal result element
that is used as the outermost element of a simplified stylesheet module
must have an xsl:version
attribute.
It is a static error if the
processor is not able to retrieve the resource identified by the URI
reference [ in the href
attribute of
xsl:include
or xsl:import
] , or if the resource that is retrieved does not contain a
stylesheet module.
An xsl:include
element must be a
top-level element.
It is a static error if a stylesheet module directly or indirectly includes itself.
An xsl:import
element must be a top-level element.
It is a static error if a stylesheet module directly or indirectly imports itself.
It is a static error if an
xsl:import-schema
element that contains an
xs:schema
element has a schema-location
attribute,
or if it has a namespace
attribute that conflicts with the target
namespace of the contained schema.
It is a static error if the synthetic schema document does not satisfy the constraints described in [XML Schema Part 1] (section 5.1, Errors in Schema Construction and Structure). This includes, without loss of generality, conflicts such as multiple definitions of the same name.
Within an XSLT element that is
required to be empty, any content other than comments or
processing instructions, including any whitespace text node preserved using the
xml:space="preserve"
attribute, is a static error.
It is a static error if there is a
stylesheet module in a
package that specifies
input-type-annotations="strip"
and another stylesheet module that specifies
input-type-annotations="preserve"
, or if a stylesheet module specifies the value
strip
or preserve
and the same value is not
specified on the xsl:package
element of the containing
package.
It is a static error if within any package the same NameTestXP30 appears in both an
xsl:strip-space
and an xsl:preserve-space
declaration if both have the same import
precedence. Two NameTests are considered the same if they match
the same set of names (which can be determined by comparing them after
expanding namespace prefixes to URIs).
In the case of a prefixed lexical QName used as the value (or as part of the value) of an attribute in the stylesheet, or appearing within an XPath expression in the stylesheet, it is a static error if the defining element has no namespace node whose name matches the prefix of the lexical QName.
Where an attribute is defined to contain a pattern, it is a static error if the pattern does not match the production Pattern30.
It is a static error if an unescaped left curly bracket appears in a fixed part of a value template without a matching right curly bracket.
It is a static error if an unescaped right curly bracket occurs in a fixed part of a value template.
An xsl:template
element must have either a
match
attribute or a name
attribute, or both. An
xsl:template
element that has no match
attribute must have no mode
attribute and no
priority
attribute. An
xsl:template
element that has no name
attribute must have no visibility
attribute.
The value of the priority
attribute [ of the
xsl:template
element]
must conform to the rules for the
xs:decimal
type defined in [XML Schema Part 2].
Negative values are permitted.
It is a static error if for any
named or unnamed mode, a package explicitly specifies two conflicting
values for the same attribute in different xsl:mode
declarations having the same import
precedence, unless there is another definition of the same
attribute with higher import precedence. The attributes in question are the
attributes other than name
on the xsl:mode
element.
It is a static error if the list of
modes [in the mode
attribute of
xsl:template
] is empty, if the same token is included more than once in the
list, if the list contains an invalid token, or if the token
#all
appears together with any other value.
It is a static error if the values of
the name
attribute of two sibling
xsl:param
elements represent the same expanded QName.
It is a static error if a variable-binding element has a
select
attribute and has non-empty content.
It is a static error if a package contains more than one non-hidden binding of a global variable with the same name and same import precedence, unless it also contains another binding with the same name and higher import precedence.
It is a static error if a package contains an
xsl:call-template
instruction whose name
attribute does not match the name
attribute of any named template
visible in the containing package (this
includes any template defined in this package, as well as templates accepted
from used packages whose visibility in this package is not
hidden
). For more details of the process of binding the
called template, see 3.5.3.5 Binding References to Components.
It is a static error if a package contains more than one non-hidden template with the same name and the same import precedence, unless it also contains a template with the same name and higher import precedence.
It is a static error
if two or more sibling xsl:with-param
elements have
name
attributes that represent the same expanded QName.
In the case of xsl:call-template
, it is a static error to pass a non-tunnel
parameter named x to a template that does not have a non-tunnel
template
parameter named x, unless the xsl:call-template
instruction is processed with
XSLT 1.0
behavior.
It is a static error if a
package contains both (a) a
named template named T that is not overridden by another
named template of higher import precedence and that has an explicitly mandatory non-tunnel parameter named
P, and (b) an xsl:call-template
instruction whose name
attribute equals T and
that has no non-tunnel xsl:with-param
child element
whose name
attribute equals P. (All names are
compared as QNames.)
It is a static error if the value
of the use-attribute-sets
attribute of an
xsl:copy
, xsl:element
, or
xsl:attribute-set
element, or the
xsl:use-attribute-sets
attribute of a literal result element, is not
a whitespace-separated sequence of EQNames, or if it contains an
EQName that does not match the name
attribute of any
xsl:attribute-set
declaration in the containing package.
If an xsl:attribute
set element specifies
streamable="yes"
then every attribute set referenced in its
use-attribute-sets
attribute (if present) must also specify
streamable="yes"
.
It is a static error if a stylesheet function has a name that is in no namespace.
It is a static error if an xsl:param
child of
an xsl:function
element has either a select
attribute or non-empty content.
It is a static error for a package to
contain two or more xsl:function
declarations with the same expanded QName, the same arity, and the same import
precedence, unless there is another xsl:function
declaration with the same
expanded QName and arity, and
a higher import precedence.
It is a static error if an attribute on a literal result element is in the XSLT namespace, unless it is one of the attributes explicitly defined in this specification.
It is a static error if a
namespace prefix is used within the
[xsl:]exclude-result-prefixes
attribute and there is
no namespace binding in scope for that prefix.
It is a static error if the
value #default
is used within the
[xsl:]exclude-result-prefixes
attribute and the parent
element of the [xsl:]exclude-result-prefixes
attribute
has no default namespace.
It is a static error if within a package there is more than one such declaration
[more than one xsl:namespace-alias
declaration] with the same literal namespace URI and the
same import precedence and
different values for the target
namespace URI, unless there is also an
xsl:namespace-alias
declaration with the same literal namespace URI and a
higher import precedence.
It is a static error if a value
other than #default
is specified for either the
stylesheet-prefix
or the result-prefix
attributes of the xsl:namespace-alias
element when there is
no in-scope binding for that namespace prefix.
It is a static error if the
select
attribute of the xsl:attribute
element
is present unless the element has empty content.
It is a static error if the
select
attribute of the xsl:value-of
element is present when the content of the element is non-empty.
It is a static error if the
select
attribute of the
xsl:processing-instruction
element is present unless the
element has empty content.
It is a static error if the
select
attribute of the xsl:namespace
element
is present when the element has content other than one or more
xsl:fallback
instructions, or if the select
attribute is absent when the element has empty content.
It is a static error if the
select
attribute of the xsl:comment
element is
present unless the element has empty content.
It is a static error if the
value
attribute of xsl:number
is present unless
the select
, level
, count
, and
from
attributes are all absent.
It is a static error if an
xsl:sort
element with a select
attribute has
non-empty content.
It is a static error if an
xsl:sort
element other than the first in a sequence of
sibling xsl:sort
elements has a stable
attribute.
It is a static error if an
xsl:perform-sort
instruction with a select
attribute has any content other than xsl:sort
and
xsl:fallback
instructions.
It is a static error if the
current-group
function is used within a pattern.
It is a static error if the
current-grouping-key
function is used within a pattern.
These four attributes [the group-by
,
group-adjacent
, group-starting-with
, and
group-ending-with
attributes of
xsl:for-each-group
] are mutually exclusive: it is a static error if none of these four attributes is present or if
more than one of them is present.
It is a static error to specify the
collation
attribute or the
composite
attribute if neither the
group-by
attribute nor group-adjacent
attribute is
specified.
It is a static error if the
xsl:analyze-string
instruction contains neither an
xsl:matching-substring
nor an
xsl:non-matching-substring
element.
It is a static error if an
xsl:key
declaration has a use
attribute and
has non-empty content, or if it has empty content and no use
attribute.
It is a static error if the
xsl:key
declaration has a collation
attribute whose value (after resolving against the base URI) is not a URI
recognized by the implementation as referring to a collation.
It is a static error if there are
several xsl:key
declarations in the same package with the
same key name and different effective collations. Two collations are the
same if their URIs are equal under the rules for comparing
xs:anyURI
values, or if the implementation can determine
that they are different URIs referring to the same collation.
It is a static error if there are
several xsl:key
declarations in a package with the same key name and
different effective values for the composite
attribute.
It is a static error if a named or
unnamed decimal format contains two
conflicting values for the same attribute in different
xsl:decimal-format
declarations having the same import precedence, unless there is
another definition of the same attribute with higher import precedence.
It is a static error if the character
specified in the zero-digit
attribute is not a digit or is a digit
that does not have the numeric value zero.
It is a static error if, for any named or unnamed decimal format, the variables representing characters used in a picture string do not each have distinct values. These variables are decimal-separator-sign, grouping-sign, percent-sign, per-mille-sign, digit-zero-sign, digit-sign, and pattern-separator-sign.
It is a static error if there is no
namespace bound to the prefix on the element bearing the
[xsl:]extension-element-prefixes
attribute or, when
#default
is specified, if there is no default namespace.
It is a static error if both the
[xsl:]type
and [xsl:]validation
attributes are
present on the xsl:element
, xsl:attribute
,
xsl:copy
, xsl:copy-of
,
xsl:document
, xsl:result-document
, xsl:source-document
, or
xsl:merge-source
elements, or on a literal result element.
It is a static error if the
value of the type
attribute of an
xsl:element
, xsl:attribute
,
xsl:copy
, xsl:copy-of
,
xsl:document
, or xsl:result-document
instruction, or the xsl:type
attribute of a literal result
element, is not a valid QName
, or if it uses a prefix that
is not defined in an in-scope namespace declaration, or if the QName is
not the name of a type definition included in the in-scope schema
components for the package.
It is a static error if the
value of the type
attribute of an
xsl:attribute
instruction refers to a complex type
definition
It is a static error if two
xsl:output
declarations within an output definition specify explicit values
for the same attribute (other than cdata-section-elements
, suppress-indentation
, and
use-character-maps
), with the values of the attributes being not
equal, unless there is another xsl:output
declaration within the
same output definition that has
higher import precedence and that specifies an explicit value for the same
attribute.
The value [of the method
attribute on
xsl:output
]
must (if present) be a valid EQName. If it is a lexical
QName with no a prefix, then it identifies a method specified in
[XSLT and XQuery Serialization] and must be one
of xml
, html
, xhtml
, or
text
.
It is a static error if a package contains two or more character maps with the same name and the same import precedence, unless it also contains another character map with the same name and higher import precedence.
It is a static error if a name in the
use-character-maps
attribute of the xsl:output
or xsl:character-map
elements does not match the
name
attribute of any xsl:character-map
in the
containing package.
It is a static error if a character
map references itself, directly or indirectly, via a name in the
use-character-maps
attribute.
A non-schema-aware
processor
must signal a static
error if a package includes an
xsl:import-schema
declaration.
A non-schema-aware
processor
must signal a static
error if a package includes an
[xsl:]type
attribute; or an [xsl:]validation
or
[xsl:]default-validation
attribute with a value other than
strip
, preserve
, or
lax
; or an
xsl:mode
element whose typed
attribute is
equal to yes
or strict
; or an as
attribute whose value is a
SequenceType that can only match
nodes with a type annotation other than xs:untyped
or
xs:untypedAtomic
(for example, as="element(*,
xs:integer)"
).
It is a static error if the number of
xsl:merge-key
children of a
xsl:merge-source
element is not equal to the number of
xsl:merge-key
children of another
xsl:merge-source
child of the same
xsl:merge
instruction.
It is a static error if no package matching the package
name and version specified in an xsl:use-package
declaration can be located.
It is a static error if a package is dependent on
itself, where package A is defined as being dependent on package
B if A contains an xsl:use-package
declaration that references B, or if A contains an
xsl:use-package
declaration that references a package
C that is itself dependent on B.
It is a static error if an xsl:use-package
declaration appears in a stylesheet module that is not in the
same stylesheet level as the principal stylesheet module
of the package.
It is a static error if the
explicit exposed visibility of a component is inconsistent with its
declared visibility, as defined in the above table. (This error occurs
only when the component declaration has an explicit
visibility
attribute, and the component is also listed
explicitly by name in an xsl:expose
declaration.)
It is a static error if a token
in the names
attribute of xsl:expose
, other
than a wildcard, matches no component in the containing package.
It is a static error if the
component
attribute of xsl:expose
specifies *
(meaning all component kinds) and the names
attribute is not a wildcard.
It is a static error if the
effect of an xsl:expose
declaration would be to make a component
abstract
, unless the component is already abstract
in the absence of the xsl:expose
declaration.
It is a static error if a token
in the names
attribute of xsl:accept
, other
than a wildcard, matches no component in the used package.
It is a static error if the
component
attribute of xsl:accept
specifies *
(meaning all component kinds) and the names
attribute is not a wildcard.
It is a static error if the
visibility assigned to a component by an xsl:accept
element is incompatible with the visibility of the corresponding
component in the used package, as defined by the above table, unless the
token that matches the component name is a wildcard, in which case the
xsl:accept
element is treated as not matching that
component.
It is a static error if the
xsl:use-package
elements in a package manifest cause two or more
homonymous components to be
accepted with a visibility other than hidden
.
It is a static error if
a token in the names
attribute of xsl:accept
,
other than a wildcard, matches the symbolic name of a component declared
within an xsl:override
child of the same
xsl:use-package
element.
It is a static error if a
component declaration appearing as a child of
xsl:override
is homonymous with any other declaration in the using package,
regardless of import
precedence, including any other overriding declaration in
the package manifest of the using package.
It is a static error if a
component declaration appearing as a child of
xsl:override
does not match (is not homonymous with) some component in the
used package.
It is a static error if the
component referenced by an xsl:override
declaration has
visibility other than
public
or abstract
It is a static error if the signature of an overriding component is not compatible with the signature of the component that it is overriding.
It is a static error to use the
component reference xsl:original
when the overridden
component has visibility="abstract"
.
It is a static error if a
top-level package (as
distinct from a library
package) contains
components whose visibility is abstract
.
It is a static error,
when the effective value of the declared-modes
attribute of
an xsl:package
element is yes
, if the
package contains an explicit reference to an undeclared mode, or if
it implicitly uses the unnamed mode and the unnamed mode is undeclared.
It is a static error if more than
one xsl:global-context-item
declaration appears within a
stylesheet module, or if several modules within a
single package contain inconsistent
xsl:global-context-item
declarations
It is a static error if the as
attribute is
present [on the xsl:context-item
element] when use="absent"
is specified.
It is a static error if the as
attribute is
present [on the xsl:global-context-item
element] when use="absent"
is specified.
It is a static error if a template
rule applicable to a mode that is defined with typed="strict"
uses a match pattern that contains a RelativePathExprP
whose
first StepExprP
is an AxisStepP
whose
ForwardStepP
uses an axis whose principal node kind is
Element
and whose NodeTest
is an
EQName
that does not correspond to the name of any global
element declaration in the in-scope schema components.
It is a static error if an
xsl:break
or xsl:next-iteration
element
appears other than in a tail position
within the sequence
constructor forming the body of an xsl:iterate
instruction.
It is a static error if the
select
attribute of xsl:break
or
xsl:on-completion
is present and the instruction has
children.
It is a static error if the
name
attribute of an xsl:with-param
child of
an xsl:next-iteration
element does not match the
name
attribute of an xsl:param
child of the
innermost containing
xsl:iterate
instruction.
It is a static error if the
select
attribute of the xsl:try
element is
present and the element has children other than xsl:catch
and
xsl:fallback
elements.
It is a static error if the
select
attribute of the xsl:catch
element is
present unless the element has empty content.
It is a static error if the
select
attribute of xsl:sequence
is present
and the instruction has children other than xsl:fallback
.
It is a static error if two sibling
xsl:merge-source
elements have the same name.
If the for-each-item
is present then the
for-each-source
, use-accumulators
, and streamable
attributes
must both be absent. If the use-accumulators
attribute is present
then the for-each-source
attribute must be present. If the
for-each-source
attribute is present then the
for-each-item
attribute must be absent.
It is a static error if an
xsl:merge-key
element with a select
attribute
has non-empty content.
It is a static error if the
select
attribute of the xsl:map-entry
element
is present unless the element has no children other than
xsl:fallback
elements.
It is a static error if the list of
accumulator names [in the use-accumulators
attribute] contains an invalid token, contains the same
token more than once, or contains the token #all
along with any
other value; or if any token (other than
#all
) is not the name of a declared-streamable accumulator visible in the containing
package.
It is a static error for a package to contain two or more non-hidden accumulators with the same expanded QName and the same import precedence, unless there is another accumulator with the same expanded QName, and a higher import precedence.
It is a static error if a package contains a construct that is declared to be streamable but which is not guaranteed-streamable, unless the user has indicated that the processor is to handle this situation by processing the stylesheet without streaming or by making use of processor extensions to the streamability rules where available.
In the case of a template rule (that is, an
xsl:template
element having a match
attribute) appearing as a child of xsl:override
, it is a
static error if the list of
modes in the mode
attribute contains #all
or
#unnamed
, or if it contains #default
and the
default mode is the unnamed mode, or if the
mode
attribute is omitted when the default mode is the
unnamed mode.
It is a static error if a
variable declared with static="yes"
is inconsistent with
another static variable of the same name that is declared earlier in
stylesheet tree order and that has lower import precedence.
It is a static error if an
xsl:apply-imports
element appears in a template rule declared within an
xsl:override
element. (To invoke the template rule
that is being overridden, xsl:next-match
should
therefore be used.)
It is a static error if the
current-merge-group
function is used within a pattern.
It is a static error if the
current-merge-key
function is used within a pattern.
It is a static error if a parameter to xsl:iterate
is
implicitly mandatory.
A processor that does not provide the
higher-order functions feature raises a static error if any of the following
XPath constructs are found in an expression, pattern,
SequenceType, or ItemType
: a
TypedFunctionTestXP30, a
NamedFunctionRefXP30, an
InlineFunctionExprXP30, or an
ArgumentPlaceholderXP30
Type errors
It is a type error if the result of evaluating the sequence constructor cannot be converted to the required type.
It is a type error if an
xsl:apply-templates
instruction with no select
attribute is evaluated when the context
item is not a node.
It is a type error if the supplied value of a variable cannot be converted to the required type.
It is a type error if the conversion of the supplied value of a parameter to its required type fails.
If the as
attribute [of
xsl:function
] is specified, then the result evaluated by the sequence constructor (see
5.7 Sequence Constructors) is converted to the required
type, using the function
conversion rules. It is a type
error if this conversion fails.
It is a type error to use the
xsl:copy
instruction with no select
attribute when the context item is absent.
It is a type error to use the
xsl:copy
or xsl:copy-of
instruction to
copy a node that has namespace-sensitive content if the
copy-namespaces
attribute has the value no
and
its explicit or implicit validation
attribute has the value
preserve
. It is also a type error if either of these
instructions (with validation="preserve"
) is used to copy an
attribute having namespace-sensitive content, unless the parent element is
also copied. A node has namespace-sensitive content if its typed value
contains an item of type xs:QName
or xs:NOTATION
or a type derived therefrom. The reason this is an error is because the
validity of the content depends on the namespace context being
preserved.
It is a type error if the
xsl:number
instruction is evaluated, with no
value
or select
attribute, when the context item is not a node.
It is a type error if the result of
evaluating the select
attribute of the xsl:number
instruction is anything other than a single node.
If any sort key value, after
atomization and any type
conversion required by the data-type
attribute, is a sequence containing more than one item, then the effect
depends on whether the xsl:sort
element is processed with XSLT 1.0
behavior. With XSLT 1.0 behavior, the effective
sort key value is the first item in the sequence. In other cases, this is a
type error.
It is a type error if the result of
evaluating the group-adjacent
expression is an empty sequence or a
sequence containing more than one item, unless
composite="yes"
is specified.
If the validation
attribute of an
xsl:element
, xsl:attribute
,
xsl:copy
, xsl:copy-of
, or
xsl:result-document
instruction, or the
xsl:validation
attribute of a literal result element, has
the effective value strict
, and schema validity assessment
concludes that the validity of the element or attribute is invalid or
unknown, a type error occurs. As
with other type errors, the error may be signaled
statically if it can be detected statically.
If the validation
attribute of an
xsl:element
, xsl:attribute
,
xsl:copy
, xsl:copy-of
, or
xsl:result-document
instruction, or the
xsl:validation
attribute of a literal result element, has
the effective value strict
, and there is no matching
top-level declaration in the schema, then a type error occurs. As with other type errors, the error
may be signaled statically if it can be detected
statically.
If the validation
attribute of an
xsl:element
, xsl:attribute
,
xsl:copy
, xsl:copy-of
, or
xsl:result-document
instruction, or the
xsl:validation
attribute of a literal result element, has
the effective value lax
, and schema validity assessment
concludes that the element or attribute is invalid, a type error occurs. As with other type
errors, the error may be signaled statically if it can
be detected statically.
It is a type error if the value of
the type
attribute of an xsl:copy
or
xsl:copy-of
instruction refers to a complex type
definition and one or more of the items being copied is an attribute
node.
It is a type error if an
[xsl:]type
attribute is defined for a constructed element
or attribute, and the outcome of schema validity assessment against that
type is that the validity
property of that element or
attribute information item is other than valid
.
A type error occurs if a
type
or validation
attribute is defined
(explicitly or implicitly) for an instruction that constructs a new
attribute node, if the effect of this is to cause the attribute value to
be validated against a type that is derived from, or constructed by list
or union from, the primitive types xs:QName
or
xs:NOTATION
.
A type error occurs [when a document node is validated] unless the children of the document node comprise exactly one element node, no text nodes, and zero or more comment and processing instruction nodes, in any order.
It is a type error if, when validating a document node, document-level constraints (such as ID/IDREF constraints) are not satisfied.
It is a type error if some item selected
by a particular merge key in one input sequence is not comparable using the
XPath le
operator with some item selected by the corresponding
sort key in another input sequence.
It is a type error if the
xsl:context-item
child of xsl:template
specifies that a context item is required and none is supplied by the
caller, that is, if the context item is absent at the point where
xsl:call-template
is evaluated.
It is a type error if an
xsl:apply-templates
instruction in a particular
mode
selects an element or attribute whose type is
xs:untyped
or xs:untypedAtomic
when the
typed
attribute of that mode specifies the value
yes
, strict
, or lax
.
It is a type error if an
xsl:apply-templates
instruction in a particular
mode
selects an element or attribute whose type is anything
other than xs:untyped
or xs:untypedAtomic
when the
typed
attribute of that mode specifies the value
no
.
It is a type error if the
result of evaluating the expression in the with-params
attribute of the xsl:evaluate
instruction is
anything other than a single map of type
map(xs:QName, item()*)
.
It is a type error if the
result of evaluating the namespace-context
attribute of the xsl:evaluate
instruction is
anything other than a single node.
It is a type error if the result of
evaluating the select
expression [of the
xsl:copy
element] is a sequence of more
than one item.
If the result of evaluating the context-item
expression
[of an xsl:evaluate
instruction] is a sequence containing more than one
item, then a type error is signaled.
A type error occurs if the result of evaluating the sequence constructor
[within an xsl:map
instruction] is
not an instance of the required type map(*)*
.
Dynamic errors
It is a dynamic error if the effective value of an attribute written using curly brackets, in a position where an attribute value template is permitted, is a value that is not one of the permitted values for that attribute. If the processor is able to detect the error statically (for example, when any XPath expressions within the curly brackets can be evaluated statically), then the processor may optionally signal this as a static error.
It is a dynamic error if the invocation of
the stylesheet specifies a template
name that does not match the expanded
QName of a named template defined in the stylesheet, whose
visibility is public
or final
.
It is a dynamic error if the invocation of the stylesheet specifies a function name and
arity that does not match the expanded
QName and arity of a named stylesheet function defined in the stylesheet, whose visibility is
public
or final
.
It is a dynamic error if the invocation of the stylesheet specifies an initial mode when no initial match selection is supplied (either explicitly, or defaulted to the global context item).
It is a dynamic error if the invocation of the stylesheet specifies an initial mode and the specified mode is not eligible as an initial mode (as defined above).
It is a dynamic error if a stylesheet declares a visible stylesheet parameter that is explicitly or implicitly mandatory, and no value for this parameter is supplied when the stylesheet is primed. A stylesheet parameter is visible if it is not masked by another global variable or parameter with the same name and higher import precedence. If the parameter is a static parameter then the value must be supplied prior to the static analysis phase.
It is a dynamic error if an element has an effective version of V (with V < 3.0) when the implementation does not support backwards compatible behavior for XSLT version V.
Where the result of evaluating an XPath expression (or an attribute value template) is required to be a lexical QName, or if it is permitted to be a lexical QName and the actual value takes the form of a lexical QName, then unless otherwise specified it is a dynamic error if the value has a prefix and the defining element has no namespace node whose name matches that prefix. This error may be signaled as a static error if the value of the expression can be determined statically.
It is a dynamic error if the sequence used to construct the content of an element node contains a namespace node or attribute node that is preceded in the sequence by a node that is neither a namespace node nor an attribute node.
It is a dynamic error if the sequence used to construct the content of a document node contains a namespace node or attribute node.
It is a dynamic error if the sequence contains two or more namespace nodes having the same name but different string values (that is, namespace nodes that map the same prefix to different namespace URIs).
It is a dynamic error if the sequence contains a namespace node with no name and the element node being constructed has a null namespace URI (that is, it is an error to define a default namespace when the element is in no namespace).
It is a dynamic error if the result sequence contains a function item.
It is a dynamic error if the
conflict resolution algorithm for template rules leaves more than
one matching template rule when the
declaration of the relevant mode has an on-multiple-match
attribute with the value fail
.
It is a dynamic error if
xsl:apply-templates
, xsl:apply-imports
or xsl:next-match
is used to process a node using a mode
whose declaration specifies on-no-match="fail"
when there is no
template rule in the stylesheet
whose match pattern matches that node.
It is a dynamic error if
xsl:apply-imports
or xsl:next-match
is
evaluated when the current template
rule is absent.
In general, a circularity in a stylesheet is a dynamic error.
It is a dynamic error if a template that has an explicitly mandatory or implicitly mandatory parameter is invoked without supplying a value for that parameter.
It is a dynamic error if the effective value of the
name
attribute [of the
xsl:element
instruction] is not a
lexical QName.
In the case of an xsl:element
instruction with no
namespace
attribute, it is a dynamic
error if the effective
value of the name
attribute is a lexical QName whose prefix is not
declared in an in-scope namespace declaration for the
xsl:element
instruction.
It is a dynamic error if the effective value of the
namespace
attribute [of the
xsl:element
instruction] is not in the
lexical space of the xs:anyURI
datatype or if it is the string
http://www.w3.org/2000/xmlns/
.
It is a dynamic error if the effective value of the name
attribute [of an xsl:attribute
instruction] is not a lexical
QName.
In the case of an xsl:attribute
instruction with no
namespace
attribute, it is a dynamic
error if the effective
value of the name
attribute is the string
xmlns
.
In the case of an xsl:attribute
instruction with no
namespace
attribute, it is a dynamic
error if the effective
value of the name
attribute is a lexical QName whose prefix is not declared
in an in-scope namespace declaration for the xsl:attribute
instruction.
It is a dynamic error if the effective value of the
namespace
attribute [of the
xsl:attribute
instruction] is not in the
lexical space of the xs:anyURI
datatype or if it is the string
http://www.w3.org/2000/xmlns/
.
It is a dynamic error if the effective value of the name
attribute [of the xsl:processing-instruction
instruction] is not both an NCNameNames and a PITargetXML.
It is a dynamic error if the string value of
the new namespace node is not valid in the lexical space of the datatype
xs:anyURI
, or if it is the string
http://www.w3.org/2000/xmlns/
.
It is a dynamic error if the effective value of the name
attribute [of the xsl:namespace
instruction] is neither a zero-length string nor an NCNameNames, or if it is xmlns
.
It is a dynamic error if the
xsl:namespace
instruction generates a namespace node whose
name is xml
and whose string value is not
http://www.w3.org/XML/1998/namespace
, or a namespace node whose
string value is http://www.w3.org/XML/1998/namespace
and whose
name is not xml
.
It is a dynamic error if evaluating the
select
attribute or the contained sequence constructor of an xsl:namespace
instruction results in a zero-length string.
It is a dynamic error if any undiscarded item
in the atomized sequence supplied as the value of the value
attribute of xsl:number
cannot be converted to an integer, or
if the resulting integer is less than 0 (zero).
It is a dynamic error if, for any sort key component, the set of
sort key values evaluated for
all the items in the initial
sequence, after any type conversion requested, contains a pair
of ordinary values for which the result of the XPath lt
operator is an error. If the processor is
able to detect the error statically, it may optionally
signal it as a static
error.
It is a dynamic error if the
collation
attribute of xsl:sort
(after
resolving against the base URI) is not a URI that is recognized by the
implementation as referring to a collation.
It is a dynamic error if the
current-group
function is used when the current group is
absent
, or when it is invoked in the course of evaluating a
pattern. The error may be reported statically if it
can be detected statically.
It is a dynamic error if the
current-grouping-key
function is used when the current
grouping key is absent, or when it is invoked in the course of evaluating a pattern.
The error may be reported statically if it can be detected
statically.
It is a dynamic error if the collation URI
specified to xsl:for-each-group
(after resolving against the
base URI) is a collation that is not recognized by the implementation. (For
notes, [see ERR XTDE1035].)
It is a dynamic error if the effective value of the regex
attribute [of the xsl:analyze-string
instruction] does not conform to the
required syntax for regular expressions, as specified in
[Functions and Operators 3.0]. If the regular expression is known
statically (for example, if the attribute does not contain any expressions enclosed in curly brackets) then
the processor may signal the error as a static error.
It is a dynamic error if the effective value of the flags
attribute [of the xsl:analyze-string
instruction] has a value other than the values defined in
[Functions and Operators 3.0]. If the value of the attribute is known
statically (for example, if the attribute does not contain any expressions enclosed in curly brackets) then
the processor may signal the error as a static error.
When a URI reference [supplied to the document
function] contains a fragment identifier, it is a dynamic error if the media type is not one that is recognized by the
processor, or if the fragment identifier does not conform to the rules for
fragment identifiers for that media type, or if the fragment identifier selects
something other than a sequence of nodes (for example, if it selects a range of
characters within a text node).
When a URI reference [supplied to the document
function] is a relative reference, it is a dynamic error if no base URI is available to
resolve the relative reference. This can arise for example when the URI is
contained in a node that has no base URI (for example a parentless text node), or
when the second argument to the function is a node that has no base URI, or when
the base URI from the static context is undefined.
It is a dynamic error if the value
[of the first argument to the key
function] is not a valid QName, or if there is no namespace
declaration in scope for the prefix of the QName, or if the name obtained by
expanding the QName is not the same as the expanded name of any
xsl:key
declaration in the containing package. If the
processor is able to detect the error statically (for example, when the argument
is supplied as a string literal), then the processor may
optionally signal this as a static
error.
It is a dynamic
error to call the key
function with
two arguments if there is no context
node, or if the root of the tree containing the context node is not a
document node; or to call the function with three arguments if the root of the
tree containing the node supplied in the third argument is not a document
node.
If the current
function is evaluated within an expression
that is evaluated when the context item is absent, a
dynamic error occurs.
It is a dynamic error if $node
,
or the context item if the second argument is omitted,
is a node in a tree whose root is not a document node.
It is a dynamic error if $node
,
or the context item if the second argument is omitted,
is a node in a tree whose root is not a document node.
It is a dynamic error if the value supplied as
the $property-name
argument [to the
system-property
function] is not a valid
QName, or if there is no namespace declaration in scope for the prefix of the
QName. If the processor is able to detect the error statically (for example, when
the argument is supplied as a string literal), then the processor
may optionally signal this as a static error.
It is a dynamic error if the argument
[passed to the function-available
function] does not evaluate to a string that is a valid EQName, or if the value is a lexical QName with a prefix for which no
namespace declaration is present in the static context. If the processor is able
to detect the error statically (for example, when the argument is supplied as a
string literal), then the processor may optionally signal this
as a static error.
It is a dynamic error if the arguments supplied to a call on an extension function do not satisfy the rules defined for that particular extension function, or if the extension function reports an error, or if the result of the extension function cannot be converted to an XPath value.
When the containing element is processed with XSLT 1.0 behavior, it is a dynamic error to evaluate an extension function call if no implementation of the extension function is available.
It is a dynamic error if the argument
[passed to the type-available
function] does not evaluate to a string that is a valid EQName, or if the value is a lexical QName with a prefix for which no
namespace declaration is present in the static context. If the processor is able
to detect the error statically (for example, when the argument is supplied as a
string literal), then the processor may optionally signal this
as a static error.
It is a dynamic error if the argument
[passed to the element-available
function] does not evaluate to a string that is a valid EQName, or if the value is a lexical QName with a prefix for which no
namespace declaration is present in the static context. If the processor is able
to detect the error statically (for example, when the argument is supplied as a
string literal), then the processor may optionally signal this
as a static error.
When a processor performs fallback for
an extension instruction
that is not recognized, if the instruction element has one or more
xsl:fallback
children, then the content of each of the
xsl:fallback
children must be
evaluated; it is a dynamic error if it has no
xsl:fallback
children.
It is a dynamic error if the effective value of the
format
attribute [of an
xsl:result-document
element] is not a valid
EQName, or if it does not match the
expanded QName of an output definition in the containing package. If the processor is able to detect
the error statically (for example, when the format
attribute
contains no curly brackets), then the processor may
optionally signal this as a static
error.
It is a dynamic error to evaluate the
xsl:result-document
instruction in temporary output state.
It is a dynamic error for a transformation to generate two or more final result trees with the same URI.
It is a dynamic error for a stylesheet to write to an external resource and read from the same resource during a single transformation, if the same absolute URI is used to access the resource in both cases.
A dynamic error may be raised if the input to the processor includes an item that requires availability of an optional feature that the processor does not provide.
It is a dynamic
error if there are two xsl:merge-key
elements
that occupy corresponding positions among the xsl:merge-key
children of two different xsl:merge-source
elements and that
have differing effective values for
any of the attributes lang
, order
,
collation
, case-order
, or data-type
.
Values are considered to differ if the attribute is present on one element and
not on the other, or if it is present on both elements with effective values that are not equal to
each other. In the case of the collation
attribute, the values are
compared as absolute URIs after resolving against the base URI. The error
may be reported statically if it is detected
statically.
It is a dynamic error if any input
sequence to an xsl:merge
instruction contains two items that
are not correctly sorted according to the merge key values defined on the
xsl:merge-key
children of the corresponding
xsl:merge-source
element, when compared using the collation
rules defined by the attributes of the corresponding
xsl:merge-key
children of the xsl:merge
instruction, unless the attribute sort-before-merge
is present
with the value yes
.
It is a dynamic error if an invocation of an abstract component is evaluated.
It is a static error if an xsl:function
element with no
xsl:param
children has a streamability
attribute with any value other than unclassified
.
It is a dynamic error if the target expression
[of an xsl:evaluate
instruction] is
not a valid expression (that is, if a static error occurs when analyzing the string
according to the rules of the XPath specification).
It is a dynamic error if an
xsl:evaluate
instruction is evaluated when use of
xsl:evaluate
has been statically or dynamically
disabled.
It is a dynamic error if the value of
$input
does not conform to the JSON grammar as defined
by [RFC 7159], allowing implementation-defined extensions
if the liberal
option is set to yes
.
It is a dynamic error if the value of
the validate
option is true
and the processor is not
schema-aware.
It is a dynamic error if the value of
$input
contains an escaped representation of a character (or
codepoint) that is not a valid character in the version of XML supported by the
implementation, unless the unescape
option is set to false.
It is a dynamic error if the value of
$options
includes an entry whose key is liberal
,
validate
, unescape
, or fallback
,
and whose value is not a permitted value for that key.
It is a dynamic error if the value of the first
argument to the accumulator-before
or
accumulator-after
function is not a valid
EQName, or if there is no namespace declaration in scope
for the prefix of the QName, or if the name obtained by expanding the QName is not
the same as the expanded name of any xsl:accumulator
declaration
appearing in the package in which the function
call appears. If the processor is able to detect the error statically (for
example, when the argument is supplied as a string literal), then the processor
may optionally signal this as a static error.
It is a dynamic error to call the
accumulator-before
or
accumulator-after
function when there is no context item.
It is a type error to call the
accumulator-before
or
accumulator-after
function when the context item is not a node, or when it is an attribute or namespace
node.
It is a dynamic error to call the
accumulator-before
or
accumulator-after
function when the context
item is a node in a tree to which the selected accumulator is not
applicable (including the case where it is not applicable
because the document is streamed and the accumulator is not
declared with streamable="yes"
). Implementations
may raise this error but are not required to do so,
if they are capable of streaming documents without imposing this restriction.
A dynamic error occurs if the set of
keys in the maps resulting from evaluating the sequence constructor
[within an xsl:map
instruction]
contains duplicates.
It is an error if there is a cyclic set of dependencies among accumulators such that the (pre- or post-descent) value of an accumulator depends directly or indirectly on itself. A processor may report this as a static error if it can be detected statically. Alternatively a processor may report this as a dynamic error. As a further option, a processor may fail catastrophically when this error occurs.
It is a dynamic error if the
current-merge-group
function is used when the current
merge group is absent. The error
may be reported statically if it can be detected
statically.
It is a dynamic error if the
$source
argument of the current-merge-group
function does not match the name
attribute of any
xsl:merge-source
element for the current merge operation. The
error may be reported statically if it can be detected
statically.
It is a dynamic error if the
current-merge-key
function is used when the current
merge key is absent, or when it is invoked
in the course of evaluating a pattern. The error may be
reported statically if it can be detected statically.
It is a dynamic error if an xsl:try
instruction is unable to recover the state of a final result tree because
recovery has been disabled by use of the attribute
rollback-output="no"
.
When a transformation is terminated by use of <xsl:message
terminate="yes"/>
, the effect is the same as when a
dynamic error occurs during the transformation. The default error code is XTMM9000
; this may be
overridden using the error-code
attribute of the
xsl:message
instruction.
When a transformation is terminated by use of xsl:assert
, the
effect is the same as when a dynamic error occurs during the
transformation. The default error code is XTMM9001
; this may be
overridden using the error-code
attribute of the
xsl:assert
instruction.