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
typeandvalidationattributes are mutually exclusive.- [2.0 – Schema]
validation Defines how the value of the new element will be validated. The
validationattribute has four values:strict,lax,preserve, orstrip. To validate a document node withstrictorlax, 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 usestrictorlax.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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access