<!DOCTYPE spec SYSTEM "../schema/xsl-query.dtd" [
<!ENTITY date.year "2003">
<!ENTITY date.month "May">
<!ENTITY date.MM "05">
<!ENTITY date.day "02">
<!ENTITY date.DD "&date.day;">
<!ENTITY doc.date "&date.year;&date.MM;&date.DD;">
<!ENTITY doc.prefix "WD-xslt-xquery-serialization">
<!ENTITY url.external "http://www.w3.org/TR/&date.year;/&doc.prefix;-&doc.date;/">
<!ENTITY url.this "&url.external;">
]>
<spec w3c-doctype="wd">

<header>
  <title>XSLT 2.0 and XQuery 1.0 Serialization</title>
  <version/>
  <w3c-designation>&doc.prefix;-&doc.date;</w3c-designation>
  <w3c-doctype>W3C Working Draft</w3c-doctype>
  <pubdate>
    <day>&date.day;</day>
    <month>&date.month;</month>
    <year>&date.year;</year>
  </pubdate>
  <publoc>
     <loc href="&url.this;">&url.this;</loc>
  </publoc>
  <altlocs>
    <loc href="&url.this;serialization.xml">XML</loc>
  </altlocs>
  <latestloc>
    <loc href="http://www.w3.org/TR/xslt-xquery-serialization/">http://www.w3.org/TR/xslt-xquery-serialization/</loc>
  </latestloc>
<!--
  <prevlocs>
    <loc href="http://www.w3.org/TR/2003/WD-xslt-xquery-serialization-20030502/">http://www.w3.org/TR/2003/WD-xslt-xquery-serialization-20030502/</loc>
  </prevlocs>
-->
  <authlist>
    <author>
      <name>Michael Kay</name>
      <affiliation>Software AG</affiliation>
      <email href="mailto:Michael.Kay@softwareag.com">Michael.Kay@softwareag.com</email>
    </author>
    <author>
      <name>Norman Walsh</name>
      <affiliation>Sun Microsystems</affiliation>
      <email href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</email>
    </author>
  </authlist>

<status>
<p>This section describes the status of this document at the time of its
publication. Other documents may supersede this document. The latest status
of this document series is maintained at the W3C.</p>

<p>This is a Public Working Draft for review by W3C Members and
other interested parties. It is a draft document and may be updated,
replaced or made obsolete by other documents at any time. It is
inappropriate to use W3C Working Drafts as reference material or to
cite them as other than "work in progress". This is work in progress
and does not imply endorsement by the W3C membership.</p>

<p>This document describes how <bibref ref="XSLT2"/> and <bibref
ref="XQuery"/> convert an instance of the <bibref ref="DataModel"/>
into a sequence of octets. This material has
been moved out of the XSLT draft and into a separate document so that
it can be shared by both the named specifications and possibly other
specifications as well.</p>

<p>XSLT 2.0 and XQuery 1.0 Serialization has been defined jointly by
the <loc href="http://www.w3.org/Style/XSL/">XSL Working Group</loc> and
the <loc href="http://www.w3.org/XML/Query">XML Query Working Group</loc>
(both part of the <loc href="http://www.w3.org/XML/Activity.html">XML Activity</loc>).
</p>

<p>Comments on this document should be sent to the W3C mailing list <loc href="mailto:public-qt-comments@w3.org">public-qt-comments@w3.org</loc>.
(archived at <loc href="http://lists.w3.org/Archives/Public/public-qt-comments/">http://lists.w3.org/Archives/Public/public-qt-comments/</loc>).
</p>

<p>A list of current W3C Recommendations and other technical documents
can be found at <loc href="http://www.w3.org/TR/">http://www.w3.org/TR/</loc>.</p>

<p>Patent disclosures relevant to this specification may be found on the
XML Query Working Group's patent disclosure page at
<loc href="http://www.w3.org/2002/08/xmlquery-IPR-statements">http://www.w3.org/2002/08/xmlquery-IPR-statements</loc>
and the XSL Working Group's patent disclosure page at
<loc href="http://www.w3.org/Style/XSL/Disclosures.html">http://www.w3.org/Style/XSL/Disclosures.html</loc>.
</p>
</status>

<abstract>
<p>This document defines serialization for the <bibref ref="XSLT2"/> and
<bibref ref="XQuery"/> specifications
and any other specifications that reference it.</p>
</abstract>

<langusage>
<language id="en">English</language>
</langusage>

<revisiondesc>
<p>See the CVS changelog.</p>
</revisiondesc>
</header>

<body>

<div1 id="intro">
<head>Introduction</head>

<p>This document defines serialization of the W3C XQuery 1.0 and XPath 2.0 Data Model,
which is the data model of at least <bibref ref="XPath2"/>,
<bibref ref="XSLT2"/>, and
<bibref ref="XQuery"/>, and any other specifications that reference it.</p>

<ednote><edtext>This material has been moved out of the XSLT draft and
into a separate document. The Working Groups also considered moving
this material directly into the Data Model document, but elected to
keep it separate for the moment, principally in order to advance the
Data Model to Last Call. In the future, this material may be moved
into the Data Model. The Working Groups solicit public opinion about
which alternative is superior.</edtext></ednote>

<p>Serialization is the process of converting an instance of the
<bibref ref="DataModel"/> into a sequence of octets. Serialization is
well-defined for most data model instances.</p>

<ednote><edtext>The document assumes the reader already knows
generally what serialization is. A brief explanation will be added,
especially to disabuse any reader who thinks it might mean Java (or
.NET) serialization.</edtext>
</ednote>

</div1>

<div1 id="serdm">
<head>Serializing Arbitrary Data Models</head>

<p>The XQuery 1.0 and XPath 2.0 Data Model is richer and less
constrained than XML. There are valid instances of the data model
that have no direct analog in XML. In particular, data model
instances can contain typed values, sequences, and sequences of typed
values. And whereas XML deals only with <quote>documents</quote>, data
model instances can have as their root any node type, simple value, or
sequence and may even be empty.</p>

<p>This section describes how to convert an arbitrary data model
instance into one of several simplified forms. We then describe how
these forms are serialized. This greatly simplifies the the sections
which follow. Implementations are not required to implement
serialization of arbitrary data model instances in this way, provided
that they produce the same results as this conceptual model.
</p>

<olist>
<item><p>If the data model instance contains any typed or untyped
values, or sequences that contain typed or untyped values, convert
them to strings: obtain the lexical representation of each value by
casting it to an <code>xs:string</code> and replace the value with its
string representation.</p>
</item>

<item><p>If adjacent strings occur in a sequence, replace both values
with their concatenation separated by a single space.</p>
</item>

<item><p>If empty sequences occur, replace them with the empty string.</p>
</item>

<item>
<p>To complete the simplification, perform the following steps
interactively until a simplest form is reached:</p>

<olist>
<item><p>If the data model instance has as its root an attribute or
namespace node, or a QName value, or if it has as its root a sequence
which contains one of these items, serialization is undefined.</p>
</item>

<item><p>If the data model instance has as its root a single document
node, or an element, processing instruction, comment, or text node, or
a sequence of only element, processing instruction, comment, and text nodes,
it is already in its simplest form.</p>
</item>

<item><p>If the data model instance has as its root a sequence of
document nodes, or a sequence which contains document nodes, replace
each document node with its children in document order.</p>
</item>

<item><p>If the data model instance has as its root a string value, or
a sequence which contains one or more string values, replace each
string value with a text node that contains the same string.</p>
</item>
</olist>
</item>
</olist>

<p>If there are any remaining string values among the children of elements in
the data model instance, replace them with text nodes that contain the same
string values and merge adjacent text nodes.</p>

</div1>

<div1 id="serparam">
<head>Serialization Parameters</head>

<p>There are a number of parameters that influence how serialization
is performed. Host languages may allow users to specify any or all of
these parameters, but they are not required to be able to do so.</p>

<p>The following serialization parameters are defined:</p>

<ednote><edtext>Here and throughout the document, the distinction between "should"
and "must" will be revisited. When serialization was described in the XSLT
specification, use of "should" helped to clarify that the serialization process
was optional. Now that it's described here in a standalone specification,
many of those clauses should use "must".</edtext></ednote>

<ulist>
<item><p><code>encoding</code> specifies the preferred character
encoding that the processor should use to encode sequences of
characters as sequences of bytes; the value of the parameter should be
treated case-insensitively; the value must contain only characters in
the range #x21 to #x7E (i.e. printable ASCII characters); the value
should either be a <code>charset</code> registered with the Internet
Assigned Numbers Authority <bibref ref="IANA"/>,
<bibref ref="RFC2278"/> or start with <code>X-</code>
</p>
<p>If this parameter is not specified, the encoding used is implementation
defined.</p>
</item>

<item><p><code>cdata-section-elements</code> specifies a list of the
names of elements whose text node children should be output using
CDATA sections</p>
<p>If this parameter is not specified, no elements will be treated specially.
</p>
</item>

<item><p><code>doctype-system</code> specifies the system identifier
to be used in the document type declaration</p>
<p>If this parameter is not specified, no system identifer will be generated.
For XML and XHTML output methods, no public identifer will be generated either,
regardless of the setting of <code>doctype-public</code>.
</p>
</item>

<item><p><code>doctype-public</code> specifies the public identifier
to be used in the document type declaration</p>
<p>If this parameter is not specified, no public identifier will be generated.
</p>
</item>

<item><p><code>escape-uri-attributes</code> specifies whether the
processor should escape URI-valued attributes in HTML and XHTML output
using the method recommended in <bibref ref="RFC2396"/> (section
2.4.1). The value must be <code>yes</code> or <code>no</code>.</p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
</item>

<item><p><code>include-content-type</code> specifies whether the serialization
process should add a <code>meta</code> element in HTML and XHTML
output. The value must be <code>yes</code> or <code>no</code>.
</p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
</item>

<item><p><code>indent</code> specifies whether the processor may add
additional whitespace when outputting the data model; the value must
be <code>yes</code> or <code>no</code></p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
</item>

<item><p><code>media-type</code> specifies the media type (MIME
content type) of the data that results from outputting the data model;
the <code>charset</code> parameter should not be specified
explicitly; instead, when the top-level media type is
<code>text</code>, a <code>charset</code> parameter should be added
according to the character encoding actually used by the output
method</p>
<p>If this parameter is not specified, the media type is implementation defined.
</p>
</item>

<item><p><code>normalize-unicode</code> indicates whether or not the
serialization process should convert the serialized output to Unicode
Normalization Form C as specified in
<bibref ref="UNICODE-NORMALIZATION"/>. The value must be <code>yes</code> or
<code>no</code>.</p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
</item>

<item><p><code>omit-xml-declaration</code> specifies whether the serialization
process should output an XML declaration; the value must be
<code>yes</code> or <code>no</code></p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
</item>

<item><p><code>standalone</code> specifies whether the processor
should output a standalone document declaration and what it's value should be;
the value must be
<code>yes</code> or <code>no</code></p>
<p>If this parameter is not specified, no standalone document declaration should
be output.
</p>
</item>

<item><p><code>undeclare-namespaces</code> specifies whether namespaces should
be undeclared during serialization; the value must be 
<code>yes</code> or <code>no</code>.</p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
<p>This parameter only applies when the XML
serialization method is used and the version is greater than 1.0.</p></item>

<item><p><code>use-character-maps</code> provides a list of character/string
pairs that are used in serialization (see <specref ref="character-maps"/>).
</p>
<p>If this parameter is not specified, no character maps are used.
</p>
</item>

<item><p><code>version</code> specifies the version of the output
method</p>
<p>If this parameter is not specified, the value is implementation defined.
</p>
</item>
</ulist>

<p>The <code>method</code> identifies the overall method that should
be used for serializing. The value of the <code>method</code>
parameter must be a valid QName. If the QName is in no namespace,
then it identifies a method specified in this document and must be one
of <code>xml</code>, <code>html</code>, <code>xhtml</code>, or
<code>text</code>. If the QName is in a namespace, then it identifies the
output method; the behavior in this case is not specified by this
document.</p>

<p>The detailed semantics of each parameter will be described
separately for each output method for which it is applicable. If the
semantics of a parameter are not described for an output method, then
it is not applicable to that output method.</p>

<p>Serialization can be regarded as involving four phases of
processing, carried out sequentially as follows:</p>

<olist>

<item><p><emph>Markup generation</emph> produces the representation of
start and end tags for elements, and other constructs such as XML
declarations, processing instructions, and so on. This is influenced
by the parameters <code>method</code>, <code>doctype-system</code>,
<code>doctype-public</code>, <code>include-content-type</code>,
<code>indent</code>, <code>omit-xml-declaration</code>,
<code>standalone</code>, and <code>version</code>.</p></item>

<item><p><emph>Character expansion</emph> is concerned with the
representation of characters appearing in text and attribute nodes in
the data model. The
substitution processes that may apply are listed below, in priority
order: a character that is handled by a one process in this list will
be unaffected by processes appearing later in the list:</p>

<ulist>
<item><p>URI escaping (in the case of URI-valued attributes in the
HTML and XHTML output methods), as determined by the
<code>escape-uri-attributes</code> parameter</p></item>

<item><p>Creation of CDATA sections, as determined by the
<code>cdata-section-elements</code> parameter. Note that this is also
affected by the <code>encoding</code> parameter, in that characters
not present in the selected encoding cannot be represented in a CDATA
section.</p></item>

<item><p>Character mapping, as determined by the
<code>use-character-maps</code> parameter.</p></item>

<item><p>Escaping of special characters according to XML or HTML
rules, for example replacing <code>&lt;</code> by
<code>&amp;lt;</code></p></item>
</ulist>
</item>

<item><p><emph>Unicode Normalization</emph>, if requested by the
<code>normalize-unicode</code> parameter. Unicode normalization is
applied to the character stream that results after all markup
generation and character expansion has taken place.</p></item>

<item><p><emph>Encoding</emph>, as controlled by the
<code>encoding</code> parameter. This converts the character stream
produced by the previous phases into a byte stream.</p></item>

</olist>
</div1>

<div1 id="xml-output">
<head>XML Output Method</head>

<p>The <code>xml</code> output method outputs the data model as an
XML entity that should satisfy the rules for either a well-formed XML
document entity, or a well-formed XML external general parsed entity,
or both. If the document node of the data model has a single element
node child and no text node children, then the serialized output
should be a well-formed XML document entity conforming to the XML
Namespaces Recommendation <bibref ref="XMLNAMES"/>. If the data model
does not take this form, then the serialized output should be an
entity which, when referenced within a trivial XML document wrapper
like this</p>

<eg><![CDATA[
<!DOCTYPE doc [
<!ENTITY e SYSTEM "]]><emph>entity-URI</emph><![CDATA[">
]>
<doc>&e;</doc>]]></eg>

<p>where <code>entity-URI</code> is a URI for the entity, produces a
document which should itself be a well-formed XML document conforming
to the XML Namespaces Recommendation <bibref ref="XMLNAMES"/>.</p>

<p>In addition, the output should be such that if a new tree was
constructed by parsing the XML document and converting it into a data
model as specified in this document, then the new data model would be
the same as starting data model, with the following possible
exceptions:</p>

<ulist>
<item>
<p>If the document was produced by adding a document wrapper, as
described above, then it will contain an extra <code>doc</code>
element as the document element.</p>
</item>
<item>
<p>The order of attribute and namespace nodes in the two trees may be
different.</p>
</item>
<item>
<p>The base URIs of nodes in the two trees may be different.</p>
</item>
<item>
<p>The new tree may contain additional attributes and text nodes resulting from the
expansion of default and fixed values in its DTD or schema.</p>
</item>
<item>
<p>The type annotations of the nodes in the two trees may be
different. Type annotations in a result tree are discarded when the
tree is serialized. Any new type annotations obtained by parsing the
document will be derived by processing the serialized XML document
against a schema, and this may result in type annotations that are
either more or less precise than those in the original result tree.
</p>
</item>
</ulist>

<p>A consequence of this rule is that certain whitespace characters
should be output as character references, to ensure that they survive
the round trip through serialization and parsing. Specifically, CR
characters in text nodes should be written as <code>&amp;#xD;</code>
or an equivalent; while CR, NL, and TAB characters in attribute nodes
should be output respectively as <code>&amp;#xD;</code>,
<code>&amp;#xA;</code>, and <code>&amp;#x9;</code>, or their
equivalents.</p>

<p>For example, an attribute with the value "x" followed by "y"
separated by a newline will result in the output
<code>"x&amp;#xA;y"</code> (or with any equivalent character
reference). The XML output cannot be "x" followed by a literal newline
followed by a "y" because after parsing, the attribute value would be
<code>"x y"</code> as a consequence of the XML attribute normalization
rules.</p>

<note><p>To anticipate the proposed changes to end-of-line handling in
XML 1.1, implementations may also output the characters x85 and x2028
as character references. This will not affect the way they are
interpreted by an XML 1.0 parser.</p></note>

<p>It is a serialization error to request the output of a document
type declaration, or of a <code>standalone</code> parameter, if the
data model contains text nodes or multiple element nodes as children
of the root node. The processor may signal the error, or may recover
by ignoring the request to output a document type declaration or
<code>standalone</code> parameter.</p>

<p>The result of serialization using the XML output method is not
guaranteed to be well-formed XML if character maps have been specified
(see <specref ref="character-maps"/>) or if nodes in the data model
contain characters that are invalid in XML (introduced, perhaps, by
calling a user-written extension function: this is an error but the
processor is not required to signal it).</p>

<div2>
<head>XML Output Method: the <code>version</code> Parameter</head>

<p>The <code>version</code> parameter specifies the version of XML to
be used for outputting the data model. If the processor does not
support this version of XML, it should use a version of XML that it
does support. The version output in the XML declaration (if an XML
declaration is output) should correspond to the version of XML that
the processor used for outputting the data model. The value of the
<code>version</code> parameter should match the <xnt
href="http://www.w3.org/TR/2000/REC-xml-20001006">VersionNum</xnt>
production of the XML Recommendation <bibref ref="XML"/>.</p>

</div2>
<div2>
<head>XML Output Method: the <code>encoding</code> Parameter</head>

<p>The <code>encoding</code> parameter specifies the preferred
encoding to use for outputting the data model. Processors are
required to respect values of <code>UTF-8</code> and
<code>UTF-16</code>. A serialization error occurs when an output
encoding other than <code>UTF-8</code> or <code>UTF-16</code> is
requested, if the implementation does not support that encoding. The
processor may signal the error, or may recover by using
<code>UTF-8</code> or <code>UTF-16</code> instead. The processor must
not use an encoding whose name does not match the <xnt
href="http://www.w3.org/TR/2000/REC-xml-20001006">EncName</xnt>
production of the XML Recommendation <bibref ref="XML"/>. If no
<code>encoding</code> parameter is specified, then the processor
should use either <code>UTF-8</code> or <code>UTF-16</code>.</p>

<p>When outputting a newline character in the data model, the
implementation is free to represent it using any character sequence
that will be normalized to a newline character by an XML parser,
unless a specific mapping for the newline character is
provided in a character map: see <specref ref="character-maps"/>.</p>

<p>When outputting any other character that is defined in the
selected encoding, the character should be output
using the correct representation of that character in the selected encoding.</p>

<p>It is possible that the data model will contain a character that
cannot be represented in the encoding that the processor is using for
output. In this case, if the character occurs in a context where XML
recognizes character references (that is, in the value of an attribute
node or text node), then the character should be output as a character
reference. A serialization error occurs if such a character appears in
a context where character references are not allowed (for example if
the character occurs in the name of an element). The processor should
signal the error.
</p>

</div2>
<div2>
<head>XML Output Method: the <code>indent</code> Parameter</head>

<p>If the <code>indent</code> parameter has the value
<code>yes</code>, then the <code>xml</code> output method may output
whitespace in addition to the whitespace in the data model (possibly
based on whitespace stripped from either the source document or the
stylesheet) in order to indent the result nicely; if the
<code>indent</code> parameter has the value <code>no</code>, it should
not output any additional whitespace. The <code>xml</code> output method should use an
algorithm to output additional whitespace that satisfies the
following constraints:</p>

<ulist>
<item><p>Whitespace characters must not be added adjacent to a text
node that contains non-whitespace characters.</p></item>

<item><p>Whitespace may only be added adjacent to an element node,
that is, immediately before a start tag or immediately after an end
tag.</p></item>

<item><p>The new whitespace characters may replace existing whitespace
characters in the same position, for example a tab may be inserted as
a replacement for existing spaces. However, existing whitespace must
not be removed without such a replacement.</p></item>

<item><p>Whitespace characters must not be inserted in a part of the
result document that is controlled by an
<code>xml:space="preserve"</code> attribute.</p></item>
</ulist>

<note><p>The effect of these rules is to ensure that whitespace may
only be added in places where (a) XSLT's <code>&lt;xsl:strip-space&gt;</code>
declaration could cause it to be removed, and
(b) it does not affect the string value of any element node with
simple content. It is usually not safe to indent document types that include elements
with mixed content.</p>
</note>

</div2>
<div2>
<head>XML Output Method: the <code>cdata-section-elements</code> Parameter</head>

<p>The <code>cdata-section-elements</code> parameter contains a list
of expanded-QNames. If the expanded-QName of the parent of a text node
is a member of the list, then the text node should be output as a
CDATA section.</p>

<p>If the text node contains the sequence of characters
<code>]]&gt;</code>, then the currently open CDATA section should be
closed following the <code>]]</code> and a new CDATA section opened
before the <code>&gt;</code>.</p>

<p>If the text node contains characters that are not
representable in the character encoding being used to output the
data model, then the currently open CDATA section should be closed
before <phrase>such characters, the characters should be output using
character references or entity references</phrase>, and a new CDATA
section should be opened for any further characters in the text
node.</p>

<p>CDATA sections should not be used except where they have been
explicitly requested by the user, either by using the
<code>cdata-section-elements</code> parameter, or by using some other
implementation-defined mechanism.</p>

<note>
<p>This is phrased to permit an implementor to provide an option that
attempts to preserve CDATA sections present in the source
document.</p>
</note>

</div2>
<div2>
<head>XML Output Method: the <code>omit-xml-declaration</code> Parameter</head>

<p>The <code>xml</code> output method should output an XML declaration
unless the <code>omit-xml-declaration</code> parameter has the value
<code>yes</code>. The XML declaration should include both version
information and an encoding declaration. If the
<code>standalone</code> parameter is specified, it should include a
standalone document declaration with the same value as the value as
the value of the <code>standalone</code> parameter. Otherwise, it
should not include a standalone document declaration; this ensures
that it is both an XML declaration (allowed at the beginning of a
document entity) and a text declaration (allowed at the beginning of
an external general parsed entity).</p>

<p>The <code>omit-xml-declaration</code> parameter should be ignored
if the <code>standalone</code> parameter is present, or if the
<code>encoding</code> parameter specifies a value other than UTF-8 or
UTF-16.</p>

</div2>
<div2>
<head>XML Output Method: the <code>doctype-system</code>
and <code>doctype-public</code> Parameters</head>

<p>If the <code>doctype-system</code> parameter is specified, the
<code>xml</code> output method should output a document type
declaration immediately before the first element. The name following
<code>&lt;!DOCTYPE</code> should be the name of the first element. If
<code>doctype-public</code> parameter is also specified, then the
<code>xml</code> output method should output <code>PUBLIC</code>
followed by the public identifier and then the system identifier;
otherwise, it should output <code>SYSTEM</code> followed by the system
identifier. The internal subset should be empty. The
<code>doctype-public</code> parameter should be ignored unless the
<code>doctype-system</code> parameter is specified.</p>

</div2>
<div2>
<head>XML Output Method: the <code>undeclare-namespaces</code> Parameter</head>

<p>The Data Model allows an element to have fewer in-scope namespaces than
its parent. In XML 1.1, this can be represented most accurately by undeclaring
namespaces. If <code>undeclare-namespaces</code> is "<code>yes</code>" and
the output method is XML and the <code>version</code> is greater than 1.1,
serialization should undeclare namespaces.</p>

<p>Consider an element <code>x:foo</code> with three in-scope
namespaces:</p>

<example>
<eg>&lt;x:foo xmlns:x="http://example.org/x"
       xmlns:y="http://example.org/y"
       xmlns:z="http://example.org/z"&gt;</eg>
</example>

<p>Suppose that it has a child element with two in-scope namespaces:</p>

<example>
<eg>&lt;x:bar xmlns:x="http://example.org/x"
       xmlns:y="http://example.org/y"&gt;...</eg>
</example>

<p>If namespace undeclaration is in effect, it will be serialized this way:</p>

<example>
<eg>&lt;x:foo xmlns:x="http://example.org/x"
       xmlns:y="http://example.org/y"
       xmlns:z="http://example.org/z"&gt;
      &lt;x:bar xmlns:z=""&gt;...&lt;/x:bar&gt;
&lt;/x:foo&gt;</eg>
</example>

<p>In XML 1.0, namespace undeclaration is not possible.</p>

</div2>
<div2>
<head>XML Output Method: Other Parameters</head>

<p>The <code>media-type</code> parameter is applicable for the
<code>xml</code> output method.</p>

<p>The <code>normalize-unicode</code> parameter is applicable for the
<code>xml</code> output method.</p>

<p>The <code>use-character-maps</code> parameter is applicable for the
<code>xml</code> output method.</p>
</div2>
</div1>

<div1 id="xhtml-output">
<head>XHTML Output Method</head>

<p>The <code>xhtml</code> output method serializes the data model as
XML, using the HTML compatibility guidelines defined in the XHTML
specification.</p>

<p>It is entirely the responsibility of the stylesheet author to
ensure that the data model conforms to the <bibref ref="XHTML10"/> or
<bibref ref="XHTML11"/> specification. It is not an error if the
data model is invalid XHTML. Equally, it is entirely under the
control of the stylesheet author whether the output conforms to XHTML
Strict, XHTML Transitional, XHTML Frameset, or XHTML Basic.</p>

<p>The serialization of the data model follows the same rules as for
the <code>xml</code> output method, with the exceptions noted below.
These differences are based on the HTML compatibility guidelines
published in Appendix C of <bibref ref="XHTML10"/>, which are designed
to ensure that as far as possible, XHTML is rendered correctly on user
agents designed originally to handle HTML.</p>

<ulist>
<item>
<p>Given an empty instance of an <phrase>XHTML</phrase> element whose
content model is not EMPTY (for example, an empty title or paragraph)
the serializer should not use the minimized form. That is, it should
output <code>&lt;p&gt;&lt;/p&gt;</code> and not
<code>&lt;p&#xa0; /&gt;</code>. </p>
</item>

<item>
<p>Given an XHTML element whose content model is EMPTY, the serializer
should use the minimized tag syntax, for example
<code>&lt;br&#xa0; /&gt;</code>, as the alternative syntax
<code>&lt;br&gt;&lt;/br&gt;</code> allowed by XML gives uncertain
results in many existing user agents. The serializer should include a
space before the trailing <code>/&gt;</code>, e.g.
<code>&lt;br&#xa0; /&gt;</code>, <code>&lt;hr&#xa0; /&gt;</code> and
<code>&lt;img&#xa0; src="karen.jpg"&#xa0; alt="Karen"&#xa0; /&gt;</code>.</p>
</item>

<item>
<p>The serializer should avoid outputting line breaks and multiple
 whitespace characters within attribute values. These are handled
 inconsistently by user agents.</p>
</item>

<item>
<p>The serializer should avoid use of the entity reference
<code>&amp;apos;</code> which, although legal in XML and therefore in
XHTML, is not defined in HTML and is not recognized by all HTML user
agents.</p>
</item>

<item><p>The serializer should output namespace declarations
in a way that is consistent with the requirements of the XHTML DTD if this is
possible. The DTD requires the declaration
<code>xmlns="http://www.w3.org/1999/xhtml"</code>
to appear on the <code>html</code> element, and only on the <code>html</code> element.
The serializer must output namespace declarations that are consistent with
the namespace nodes present in the result tree, but it should avoid outputting
redundant namespace declarations on elements where the DTD would make them invalid.</p>

<note><p>Although the specification of the namespace fixup process provides
no guarantees about the namespace prefixes that are allocated,
implementors are encouraged to ensure that where possible,
writing the literal result element
<code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; ... &lt;/html&gt;</code>
places the resulting <code>html</code> element in the default namespace.</p></note>
</item>

<item>
<p>If <phrase>the data model includes a <code>head</code> element in
the XHTML namespace</phrase>, then unless the
<code>include-content-type</code> parameter has the
value <code>"no"</code>, the <code>xhtml</code> output method should
add a <code>meta</code> element immediately after the start-tag of the
<code>head</code> element specifying the character encoding actually
used.</p>

<example>
<p>For example,</p>
<eg><![CDATA[<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"/>
...]]></eg>
</example>

<p>The content type should be set to the value given for the
<code>media-type</code> parameter; the default value for XHTML is
<code>text/html</code>. The value <code>application/xhtml+xml</code>,
registered in <bibref ref="RFC3236"/>, may also be used.</p>
</item>

<item>
<p>Unless the <code>escape-uri-attributes</code> parameter
has the value <code>no</code>, the <code>xhtml</code> output
method should escape non-ASCII characters in URI attribute values
using the method recommended in <bibref ref="RFC2396"/> (section
2.4.1).</p>
</item>
</ulist>

<note>
<p>This escaping is deliberately confined to non-ASCII characters,
because escaping of ASCII characters is not always appropriate, for
example when URIs or URI fragments are interpreted locally by the HTML
user agent. Even in the case of non-ASCII characters, escaping can
sometimes cause problems. More precise control of URI escaping is
therefore available by setting <code>escape-uri-attributes</code> to
<code>no</code>, and controlling the escaping of URIs by means of the
<function>fn:escape-uri</function> function defined in <bibref ref="FANDO"/>.</p>
</note>

<note><p>As with the XML output method, the XHTML
output method outputs an XML declaration unless it is suppressed using
the <code>omit-xml-declaration</code> parameter. Appendix C.1 of the
XHTML specification provides advice on the consequences of including,
or omitting, the XML declaration.</p></note>
</div1>

<div1>
<head>HTML Output Method</head>

<p>The <code>html</code> output method outputs the data model as
HTML.</p>

<example>
<p>For example,</p>
<eg><![CDATA[<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>

...

</xsl:stylesheet>]]></eg>
</example>

<p>The <code>version</code> parameter indicates the version of the
HTML. The default value is <code>4.0</code>, which specifies that the
result should be output as HTML conforming to the HTML 4.0
Recommendation <bibref ref="HTML"/>.</p>

<div2>
<head>HTML Output Method: Markup for Elements</head>

<p>The <code>html</code> output method should not output an element
differently from the <code>xml</code> output method unless the
expanded-QName of the element has a null namespace URI; an element
whose expanded-QName has a non-null namespace URI should be output as
XML. If the expanded-QName of the element has a null namespace URI,
but the local part of the expanded-QName is not recognized as the name
of an HTML element, the element should output in the same way as a
non-empty, inline element such as <code>span</code>. In particular:</p>

<olist>
<item><p>If the result tree contains namespace nodes for namespaces other than the
XML namespace, the HTML output method will represent these namespaces using
attributes named <code>xmlns</code> or <code>xmlns:</code><emph>prefix</emph>
in the same way as the XML output method would represent them when the
version parameter is set to 1.0.</p>
</item>

<item><p>If the result tree contains elements or attributes whose names have a
non-null namespace URI, the HTML output method will generate
namespace-prefixed QNames for these nodes in the same way as the XML output
method would do when the version parameter is set to 1.0.</p></item>

<item><p>Where special rules are defined later in this section for
serializing specific HTML elements and attributes, these rules are
never applied to an element or attribute whose name has a non-null
namespace URI. However, the generic rules for the HTML output method
that apply to all elements and attributes, for example the rules for
escaping special characters in the text and the rules for indentation,
must be used also for namespaced elements and attributes.</p>
</item>

<item><p>When serializing an element whose name is not defined in the
HTML specification, but that is in the null namespace, the HTML output
method should apply the same rules (for example, indentation rules) as
when serializing a <code>span</code> element. The descendants of such
an element should be serialized as if they were descendants of a
<code>span</code> element.</p>
</item>

<item><p>When serializing an element whose name is in a non-null
namespace, the HTML output method should apply the same rules (for
example, indentation rules) as when serializing a <code>div</code>
element. The descendants of such an element should be serialized as if
they were descendants of a <code>div</code> element.</p>
</item>
</olist>

<p>The <code>html</code> output method should not output an end-tag
for empty elements. For HTML 4.0, the empty elements are
<code>area</code>, <code>base</code>, <code>basefont</code>,
<code>br</code>, <code>col</code>, <code>frame</code>,
<code>hr</code>, <code>img</code>, <code>input</code>,
<code>isindex</code>, <code>link</code>, <code>meta</code> and
<code>param</code>. For example, an element written as
<code>&lt;br/&gt;</code> or <code>&lt;br&gt;&lt;/br&gt;</code> in an
XSLT stylesheet should be output as <code>&lt;br&gt;</code>.</p>

<p>The <code>html</code> output method should recognize the names of
HTML elements regardless of case. For example, elements named
<code>br</code>, <code>BR</code> or <code>Br</code> should all be
recognized as the HTML <code>br</code> element and output without an
end-tag.</p>

<p>The <code>html</code> output method should not perform escaping for
the content of the <code>script</code> and <code>style</code>
elements.</p>

<example>
<p>For example, a literal result element such as:</p>
<eg><![CDATA[<script>if (a &lt; b) foo()</script>]]></eg>
<p>or</p>
<eg><![CDATA[<script><![CDATA[if (a < b) foo()]]]]><![CDATA[></script>]]></eg>
<p>should be output as</p>
<eg><![CDATA[<script>if (a < b) foo()</script>]]></eg>
</example>

<example>
<p>A common requirement is to output a <code>script</code> element
as shown in the example below:</p>

<eg><![CDATA[<script type="text/javascript">
      document.write ("<em>This won't work</em>")
</script>]]></eg>

<p>This is illegal HTML, for the reasons explained in section B.3.2 of
the HTML 4.01 specification. Nevertheless, it is possible to output
this fragment, using either of the following constructs:</p>

<p>Firstly, by use of a literal result element:</p>

<eg><![CDATA[<script type="text/javascript">
      document.write ("<em>This won't work</em>")
</script>]]></eg>

<p>Secondly, by constructing the markup from ordinary text characters:</p>

<eg><![CDATA[<script type="text/javascript">
      document.write ("&lt;em&gt;This won't work&lt;/em&gt;")
</script>]]></eg>

<p>As the HTML specification points out, the correct way to write this
is to use the escape conventions for the specific scripting language.
For JavaScript, it can be written as:</p>

<eg><![CDATA[<script type="text/javascript">
      document.write ("&lt;em&gt;This will work&lt;\/em&gt;")
</script>]]></eg>

<p>The HTML 4.01 specification also shows examples of how to write
this in various other scripting languages. The escaping must be done
manually, it will not be done by the serializer.</p>
</example>

</div2>
<div2>
<head>HTML Output Method: Writing Attributes</head>

<p>The <code>html</code> output method should not escape
"<code>&lt;</code>" characters occurring in attribute values.</p>

<p>If the <code>indent</code> parameter has the value
<code>yes</code>, then the <code>html</code> output method may add or
remove whitespace as it outputs the data model, so long as it does
not change how an HTML user agent would render the output.</p>

<p>Unless the <code>escape-uri-attributes</code> parameter is present
and has the value <code>no</code>, the <code>html</code> output method
should escape non-ASCII characters in URI attribute values using the
method recommended in <bibref ref="RFC2396"/> (section 2.4.1).</p>

<note>
<p>This escaping is deliberately confined to non-ASCII characters,
because escaping of ASCII characters is not always appropriate, for
example when URIs or URI fragments are interpreted locally by the HTML
user agent. Even in the case of non-ASCII characters, escaping can
sometimes cause problems. More precise control of URI escaping is
therefore available by setting <code>escape-uri-attributes</code> to
<code>no</code>, and controlling the escaping of URIs by means of the
<function>fn:escape-uri</function> function defined in <bibref
ref="FANDO"/>.</p>
</note>

<p>The <code>html</code> output method should output boolean
attributes (that is attributes with only a single allowed value that
is equal to the name of the attribute) in minimized form.</p>

<example>
<p>For example, a start-tag written in the stylesheet as</p>
<eg>&lt;OPTION selected="selected"&gt;</eg>
<p>should be output as</p>
<eg>&lt;OPTION selected&gt;</eg>
</example>

<p>The <code>html</code> output method should not escape a
<code>&amp;</code> character occurring in an attribute value
immediately followed by a <code>{</code> character (see <loc
href="http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.7.1.1">Section
B.7.1</loc> of the HTML 4.0 Recommendation).</p>

<example>
<p>For example, a start-tag written in the stylesheet as</p>
<eg>&lt;BODY bgcolor='&amp;{{randomrbg}};'&gt;</eg>
<p>should be output as</p>
<eg>&lt;BODY bgcolor='&amp;{randomrbg};'&gt;</eg>
</example>

</div2>
<div2><head>HTML Output Method: Indentation</head>

<p>If the <code>indent</code> attribute has the value
<code>yes</code>, then the <code>html</code> output method may add or
remove whitespace as it outputs the result tree, so long as it does
not change the way that a conforming HTML user agent would render the output.  The
default value is <code>yes</code>.</p>

<note><p>This rule can be satisfied by observing the
following constraints:</p>

<p>Whitespace must only be added before or after an element,
or adjacent to an existing whitespace character.</p>
<p>Whitespace must not be added or removed adjacent to an inline element,
the inline elements being those included in the <code>%inline</code>
category in the HTML 4.01 DTD.</p>
<p>Whitespace must not be added or removed inside a formatted element,
the formatted elements being <code>pre</code>, <code>script</code>,
<code>style</code>, and <code>textarea</code>.</p>

<p>Note that the HTML definition of whitespace is different from the XML definition:
see section 9.1 of the HTML 4.01 specification.</p>
</note>

</div2>
<div2><head>HTML Output Method: Writing Character Data</head>

<p>The <code>html</code> output method may output a character using a
character entity reference in preference to using a numeric character
reference, if an entity is defined for the character in the version of
HTML that the output method is using. Entity references and character
references should be used only where the character is not present in
the selected encoding, or where the visual representation of the
character is unclear (as with <code>&amp;nbsp;</code>, for
example).</p>

<p>When outputting a sequence of whitespace characters in the data
model, within an element where whitespace is treated normally,
<phrase>(but not in elements such as <code>pre</code> and
<code>textarea</code>)</phrase> the <code>html</code> output method is
free to represent it using any character sequence that will be treated
as whitespace by an HTML user agent.</p>

<p>Certain characters, specifically the control characters #x7F-#x9F,
are legal in XML but not in HTML. It is an error to use the HTML
output method when such characters appear in the data model. The
processor may signal the error, but is not required to do so. If it
does not signal the error, it may copy the offending characters into
the serialized output, creating invalid HTML.</p>

<p>The <code>html</code> output method should terminate processing
instructions with <code>&gt;</code> rather than
<code>?&gt;</code>.</p>

</div2>
<div2>
<head>HTML Output Method: Encoding</head>

<p>The <code>encoding</code> parameter specifies the preferred
encoding to be used. If there is a <code>HEAD</code> element, then
unless the <code>include-content-type</code> parameter is present and
has the value <code>"no"</code>, the <code>html</code> output method
should add a <code>META</code> element immediately after the start-tag
of the <code>HEAD</code> element specifying the character encoding
actually used.</p>

<example>
<p>For example,</p>
<eg>&lt;HEAD>
&lt;META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
...</eg>
</example>

<p>The content type should be set to the value given for the
<code>media-type</code> parameter; the default value is
<code>text/html</code>.</p>

<p>It is possible that the data model will contain a character that
cannot be represented in the encoding that the processor is using for
output. In this case, if the character occurs in a context where HTML
recognizes character references, then the character should be output
as a character entity reference or decimal numeric character
reference; otherwise (for example, in a <code>script</code> or
<code>style</code> element or in a comment), the processor should
signal a serialization error.
</p>
</div2>

<div2>
<head>HTML Output Method: Document Type Declaration</head>

<p>If the <code>doctype-public</code> or <code>doctype-system</code>
parameters are specified, then the <code>html</code> output method
should output a document type declaration immediately before the first
element. The name following <code>&lt;!DOCTYPE</code> should be
<code>HTML</code> or <code>html</code>. If the
<code>doctype-public</code> parameter is specified, then the output
method should output <code>PUBLIC</code> followed by the specified
public identifier; if the <code>doctype-system</code> parameter is
also specified, it should also output the specified system identifier
following the public identifier. If the <code>doctype-system</code>
parameter is specified but the <code>doctype-public</code> parameter
is not specified, then the output method should output
<code>SYSTEM</code> followed by the specified system identifier.</p>

</div2>
<div2>
<head>HTML Output Method: Other Parameters</head>

<p>The <code>media-type</code> parameter is applicable for the
<code>html</code> output method.</p>

<p>The <code>normalize-unicode</code> parameter is applicable for the
<code>html</code> output method.</p>

<p>The <code>use-character-maps</code> parameter is applicable for the
<code>html</code> output method.</p>
</div2>
</div1>

<div1>
<head>Text Output Method</head>

<p>The <code>text</code> output method outputs the data model by
outputting the string-value of every text node in the data model in
document order without any escaping.</p>

<p>A newline character in the data model may be output using any
character sequence that is conventionally used to represent a line
ending in the chosen system environment.</p>

<p>The <code>media-type</code> parameter is applicable for the
<code>text</code> output method.</p>

<p>The <code>encoding</code> parameter identifies the encoding that
the <code>text</code> output method should use to convert sequences of
characters to sequences of bytes. The default is
<phrase>implementation-defined</phrase>. If the data model contains a
character that cannot be represented in the encoding that the
processor is using for output, the implementation should signal a
serialization error.</p>

<p>The default encoding for the <code>text</code> output method is
implementation-defined.</p>

<p>The <code>unicode-normalization</code> parameter is applicable for the
<code>text</code> output method.</p>

<p>The <code>use-character-maps</code> parameter is applicable for the
<code>html</code> output method.</p>
</div1>

<div1 id="character-maps">
<head>Character Maps</head>

<p>The <code>use-character-maps</code> parameter is a list of characters
and corresponding string substitutions.</p>

<p>Character maps allow a specific character appearing in a text or
attribute node in the data model to be substituted by a specified
string of characters during serialization. The string that is
substituted is output "as is", and the serializer performs no checks
that the resulting document is well-formed. This mechanism can
therefore be used to introduce arbitrary markup in the serialized
output.</p>

<p>Character mapping is applied to the characters that actually appear
in a text or attribute node in the data model, before any other
serialization operations such as escaping or Unicode normalization are
applied. If a character is mapped, then it is not subjected to XML or
HTML escaping, nor to Unicode normalization. The string that is
substituted for a character is not validated or processed in any way
by the serializer, except for translation into the target encoding. In
particular, it is not subjected to XML or HTML escaping, it is not
subjected to Unicode normalization, and it is not subjected to further
character mapping. If the string cannot be represented using the
target encoding, the serializer takes the same action as it would if
the offending characters appeared directly in the data model.</p>

<p>Character mapping is not applied to characters in text nodes whose
parent elements are listed in the <code>cdata-section-elements</code>
parameter, nor to characters in attribute
values that are subject to the URI escaping defined for the HTML and
XHTML output methods, unless URI escaping has been disabled using the
<code>escape-uri-attributes</code> parameter in the output
definition.</p>

<p>On serialization, occurrences of a character specified in the
<code>use-character-maps</code> in text nodes and attribute values
are replaced by the corresponding string from the <code>use-character-maps</code>
parameter.</p>

<note><p>Using a character map can result in non-well-formed documents
if the string contains XML-significant
characters. For example, it is possible to create documents containing
unmatched start and end tags, references to entities that are not
declared, or attributes that contain tags or unescaped quotation
marks.</p></note>

<p>Character mapping is applied to the characters that actually appear
in a text or attribute node in the data model, before any other
serialization operations such as escaping or Unicode normalization are
applied.</p>

<p>Character mapping is not applied to characters for which output
escaping has been disabled (disabling output escaping is an <bibref
ref="XSLT2"/> feature), nor to characters in text nodes whose parent
elements are listed in the <code>cdata-section-elements</code> parameter,
nor to characters in attribute values that are
subject to the URI escaping defined for the HTML and XHTML output
methods, unless URI escaping has been disabled using the
<code>escape-uri-attributes</code> parameter.</p>

<p>If a character is mapped, then it is not subjected to XML or HTML escaping.</p>

<p>A serialization error occurs if character mapping causes the output
of a string containing a character that cannot be represented in the
encoding that the processor is using for output. The processor should
signal the error.</p>

</div1>
</body>

<back>

<div1>
<head>References (Normative)</head>
<blist>

<bibl id="DataModel" key="Data Model">
  World Wide Web Consortium,
  <emph>XQuery 1.0 and XPath 2.0 Data Model</emph>.
  See <loc href="http://www.w3.org/TR/xpath-datamodel/">http://www.w3.org/TR/xpath-datamodel/</loc>.
</bibl>

<bibl id="FANDO" key="Functions and Operators">
  World Wide Web Consortium,
  <emph>XQuery 1.0 and XPath 2.0 Functions and Operators.</emph>
  W3C Working Draft. See <loc href="http://www.w3.org/TR/xpath-functions/"/>.
</bibl>

<bibl id="HTML" key="HTML">World Wide Web Consortium. <emph>HTML 4.01
specification</emph>. W3C Recommendation.
See <loc href="http://www.w3.org/TR/html4/"/>.</bibl>

<bibl id="IANA" key="IANA">Internet Assigned Numbers
Authority. <emph>Character Sets</emph>.
See <loc href="http://www.iana.org/assignments/character-sets"/>.</bibl>

<bibl id="RFC2278" key="RFC2278">N. Freed, J. Postel.  <emph>IANA
Charset Registration Procedures</emph>.  IETF RFC 2278.
See <loc href="http://www.ietf.org/rfc/rfc2278.txt"/>.</bibl>

<bibl id="RFC2396" key="RFC2396">T. Berners-Lee, R. Fielding, and
L. Masinter.  <emph>Uniform Resource Identifiers (URI): Generic
Syntax</emph>. IETF RFC 2396.
See <loc href="http://www.ietf.org/rfc/rfc2396.txt"/>.</bibl>

<bibl id="RFC3236" key="RFC3236">M. Baker, P. Stark.
<emph>The 'application/xhtml+xml' Media Type</emph>.  IETF RFC 3236.
See <loc href="http://www.ietf.org/rfc/rfc3236.txt"/>.</bibl>

<bibl id="UNICODE-NORMALIZATION" key="Unicode Normalization">Unicode Consortium.
<emph>Unicode Normalization Forms</emph>. Unicode Standard Annex #15.
See <loc href="http://www.unicode.org/unicode/reports/tr15/"/>.
</bibl>

<bibl id="XHTML10" key="XHTML 1.0">World Wide Web Consortium. <emph>XHTML
1.0: The Extensible HyperText Markup Language (Second Edition).</emph>
W3C Recommendation. See <loc href="http://www.w3.org/TR/xhtml1/"/>.</bibl>

<bibl id="XHTML11" key="XHTML 1.1">World Wide Web Consortium. <emph>XHTML
1.1: Module-Based XHTML.</emph> W3C Recommendation.
See <loc href="http://www.w3.org/TR/xhtml11/"/>.
</bibl>

<bibl id="XML" key="XML">World Wide Web Consortium. <emph>Extensible
Markup Language (XML) 1.0 (Second Edition)</emph> W3C Recommendation.
See <loc href="http://www.w3.org/TR/2000/REC-xml-20001006"/>.</bibl>

<bibl id="XMLNAMES" key="XML Names">World Wide Web
Consortium. <emph>Namespaces in XML.</emph> W3C Recommendation. See
<loc href="http://www.w3.org/TR/REC-xml-names/"/>.
</bibl>

<bibl id="XPath2" key="XPath 2.0">
  World-Wide Web Consortium,
  <emph>XML Path Language (XPath) 2.0.</emph>
  See <loc href="http://www.w3.org/TR/xpath20/">http://www.w3.org/TR/xpath20/</loc>.
</bibl>

<bibl id="XQuery" key="XQuery 1.0">
  World Wide Web Consortium,
  <emph>XQuery 1.0: An XML Query Language</emph>.
  See <loc href="http://www.w3.org/TR/xquery/">http://www.w3.org/TR/xquery/</loc>.
</bibl>

<bibl id="XSLT2" key="XSLT 2.0">
  World Wide Web Consortium,
  <emph>XSL Transformations Language (XSLT) Version 2.0.</emph>
  See <loc href="http://www.w3.org/TR/xslt20/">http://www.w3.org/TR/xslt20/</loc>.
</bibl>

</blist>
</div1>

</back>
</spec>
