O'Reilly logo

XSLT, 2nd Edition by Doug Tidwell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

<xsl:copy-of>

Creates a deep copy of a node.

Category

Instruction.

Required Attribute

select

Contains an XPath expression that defines the nodes to be copied to the output document.

Optional Attributes

[2.0] copy-namespaces

Defines whether namespaces should be copied. This applies only when copying an element node. Allowed values are yes (the default) and no.

[2.0 – Schema] type

Defines the datatype of the copied node. The datatype can be any of the built-in datatypes, or it can be a datatype defined in a schema if you have a schema-aware XSLT 2.0 processor.

The type and validation attributes are mutually exclusive.

[2.0 – Schema] validation

Defines how the value of the copied node will be validated. The validation attribute has four values: strict, lax, preserve, or strip.

validation="strict" means that the XSLT processor looks in all the declared schemas for a node declaration (<xs:attribute> or <xs:element>) with the same name as this node. It is a fatal error if the processor can’t find a matching declaration. Assuming the processor finds the declaration of the attribute or element node, it validates the generated value against its declaration in the schema.

validation="lax" works just like validation="strict", except that no error occurs if the processor can’t find the declaration of the node in any of the declared schemas. In that case, the type annotation of a copied attribute or element is xs:untypedAtomic or xs:untyped, respectively.

The value validation="preserve" means that all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required