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

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

xsl:result-document

The

instruction is used to create a new result tree, and optionally to specify how the result tree should be serialized. The facility allows a transformation to produce multiple result documents, so you can write a stylesheet that splits a large XML file into smaller XML files, or into multiple HTML files, perhaps connected to each other by hyperlinks.

Changes in 2.0

This instruction is new in XSLT 2.0. Many XSLT 1.0 processors provided a similar capability as a proprietary extension, but there are likely to be differences in the detail. The abandoned working draft of XSLT 1.1 used the name

for a similar instruction, and it was implemented under this name in some products.

Format

  format? = { 
qname
 }

  href? = { 
uri-reference
 }

  validation? = “strict” | “lax” | “preserve” | “strip”

  type? = qname

  method? = { “xml” | “html” | “xhtml” | “text” | qname-but-not-ncname }

  byte-order-mark? = { “yes” | “no” }

  cdata-section-elements? = { qnames }

  doctype-public? = { string }

  doctype-system? = { string }

  encoding? = { string }

  escape-uri-attributes? = { “yes” | “no” }

  include-content-type? = { “yes” | “no” }

  indent? = { “yes” | “no” }

  media-type? = { string }

  normalization-form? = {“NFC”|“NFD”|“NFKC”|“NFKD”|“fully-normalized”|nmtoken}

  omit-xml-declaration? = { “yes” | “no” }

  standalone? = { “yes” | “no” | “omit” }

  undeclare-prefixes? = { “yes” | “no” }

  use-character-maps? = qnames

  output-version? = { nmtoken }

>

  


Position


is an instruction, which means it may occur anywhere in a sequence constructor.

Attributes

Name
Value
Meaning
format
optional
Attribute value template returning a lexical QName
Defines the required output format.
href
optional
Attribute value template returning a relative or absolute URI
Defines the location where the output document will be written after serialization.
validation
optional
strict
,
lax
,
preserve
, or
strip
Defines the validation to be applied to the result tree.
type
optional
Lexical QName
Defines the schema type against which the document element should be validated.
method
optional
Attribute value template returning
xml
,
html
,
xhtml
,
text
, or a prefixed lexical QName
Defines the serialization method to be used.

Other books

Where There's Smoke by Mel McKinney
The Duke and The Governess by Norton, Lyndsey
The Ravishing One by Connie Brockway
Nocturne by Charles Sheehan-Miles
Faerie Wars 01 - Faerie Wars by Brennan, Herbie
Shiftless by Easterling, Aimee
Middle Age by Joyce Carol Oates
Can You Keep a Secret? by R. L. Stine
The Walls Have Eyes by Clare B. Dunkle