<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="changes" page="s90" subpage="serialization90"/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Serialization</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Serialization"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Serialization</h1> <p>The serialization property <code>byte-order-mark="yes"</code> is now honored when the selected encoding is <code>utf-16le</code> or <code>utf-16be</code>.</p> <p>The HTML serialization method now uses named entity references in preference to decimal character references for characters outside the specified encoding, where an entity reference is known. Since the list of known entity references is confined to characters in the range xA0 to xFF, this only really affects the outcome when encoding="us-ascii". More detailed control is available using <code>saxon:character-representation</code>, though this may have to be changed in future since it is technically non-conformant - vendor-defined serialization attributes are no longer allowed to cause behaviour that contradicts the provisions of the serialization specification.</p> <p>Saxon now implements the change to the specification made as a result of <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=3441" class="bodylink">bug 3441</a>: with the HTML and XHTML output methods, any generated <code><meta></code> element is now produced earlier in the serialization pipeline, which has the effect that characters in this element are subject to substitution by means of character maps.</p> <p>A new serialization method <code>saxon:xquery</code> is available. This is intended to be useful when generating an XQuery query as the output of a query or stylesheet. This method differs from the XML serialization method in that "<" and ">" characters appearing between curly braces (but not between quotes) in text nodes and attribute nodes are not escaped. The idea is to allow queries to generated, or to be written within an XML document, and processed by first serializing them with this output method, then parsing the result with the XQuery parser. For example, the document <code><a>{$a &lt; '&lt;'}</a></code> will serialize as <code><a>{$a < '&lt;'}</a></code>. </p> <p>With the XML output method, indentation is now suppressed for any element that is known to have mixed content: specifically, any element that is validated against a user-defined type (not xs:anyType or xs:untyped) that specifies <code>mixed="true"</code> in the schema. No whitespace will be added to the content of such an element. For simplicity, the option applies to all the descendants of the element, even if there are descendants that do not allow mixed content.</p> <p>A new serialization parameter <code>saxon:suppress-indentation</code> is introduced for the XML output method. (It does not affect the HTML or XHTML output methods.) The value of the attribute is a whitespace-aeparated list of element names, and it works in the same way as <code>cdata-section-elements</code> (for example, values in <code>xsl:output</code> and <code>xsl:result-document</code> are cumulative). Its effect is that no indentation takes place for the children or descendants of any of the named elements (just as if they specified <code>xml:space="preserve"</code>. This option is useful where parts of the output document contain mixed content where whitespace is significant.</p> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="localization90.xml">Next</a></p> </td> </tr> </table> </body> </html>