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

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

or
type = “xs:ID”
. But it can also be a list or union type, for example
type = “xs:IDREFS”
.

If
xsl:copy
or
xsl:copy-of
is used to create attribute nodes by copying nodes from a source document, attribute-level validation can be invoked using the
validation
and
type
attributes in the same way. Unlike the situation with elements,
preserve = “yes”
on either of these instructions means what it says: the attribute is copied together with its type annotation.

There are special rules in the language specification concerning the validation of attributes whose type is
xs:QName
or
xs:NOTATION
. Since these types require a namespace context to perform the validation, you can't validate standalone attributes that have these types. They can only be validated as part of an element that has the appropriate namespaces in scope.

The default-validation Attribute

The
default-validation
attribute on the

element can take one of the two values
preserve
or
strip
, and it defines the default that is used on any of the instructions

,

,

,

,

, and

when neither a
type
nor a
validation
attribute is specified explicitly.

Other books

2: Leer - Pack Takeover by Weldon, Carys
The Time of Our Lives by Jane Costello
Blood Rights by Painter, Kristen
Beautiful Music by Lammers, Kathlyn
Caden's Vow by Sarah McCarty
The House of Discontent by Esther Wyndham
Beautyandthewolf by Carriekelly