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

[2.0] <xsl:document>

Allows you to create a new document node. This element is useful for validating the document node against a schema. The document node created by <xsl:document> is not meant to be serialized (written to disk); if that’s what you want to do, use <xsl:result-document> instead.

Category

Instruction.

Required Attributes

None.

Optional Attributes

[2.0 – Schema] type

Defines the datatype of the root element node created by this element. To validate a document node, it must have as its children a single element node, no text nodes and zero or more comment and processing instruction nodes. If the document node doesn’t have this structure, the XSLT processor throws an error.

The type and validation attributes are mutually exclusive.

[2.0 – Schema] validation

Defines how the value of the new element will be validated. The validation attribute has four values: strict, lax, preserve, or strip. To validate a document node with strict or lax, the document node must have as its children a single element node, no text nodes, and zero or more comment and processing instruction nodes. If the document node doesn’t have this structure, the XSLT processor throws an error if you use strict or lax.

validation="strict" means that the XSLT processor looks in all the declared schemas for an element declaration (<xs:element>) with the same name as the single element node that is a child of this document node. It is a fatal error if the processor can’t find a matching <xs:element>. Assuming 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