A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/896.html
Document ID: 896 Branch: main Language: default Name: HTMLSerializer (unchanged) Document Type: Sitemap Component (unchanged) Updated on: 9/24/08 3:44:37 PM Updated by: David Legg A new version has been created, state: draft Parts ===== Long description ---------------- This part has been added. Mime type: text/xml File name: null Size: 2873 bytes Content: <html> <body> <p>The HTMLSerializer is used to render the final output of a Cocoon pipeline as HTML; suitable for a web browser to understand.</p> <p>Though HTML and XML look similar there are a number of subtle differences. The standard HTMLSerializer actually delegates the job of transformation to the JAXP (Java API for XML Parsing) 'html' output method. By default in Cocoon this is implemented by the Xalan processor (though other XSLT processors can be used). This method performs the following actions: -</p> <ul> <li>Certain empty tags are not closed. For example <br/> or <br></br> elements will be output as <br>. For HTML 4.01 the empty elements are: <em>area</em>, <em>base</em>, <em>basefont</em> ,<em> br</em> , <em>col</em>,<em> frame</em>, <em>hr</em> , <em>img</em>, <em>input</em>, <em>isindex</em>, <em>link</em>, <em>meta </em>and <em>param</em>. Note that some of these tags are deprecated in some versions of HTML.</li> <li>Tags are considered to be case insensitive. Therefore <br/> or <BR></BR> or <Br></Br> will all be recognized as the html br tag and be output as <br> with no end tag.</li> <li>Any content between <em>script </em>or <em>style </em>tags is not escaped. For example: <script> if (a &lt; b) foo()</script> will be output as: <script>if (a < b) foo()</script></li> <li>Attribute values containing '<' characters are not escaped.</li> <li>Boolean attributes are output in shortened form. For example: <option selected="selected"> is output as: <option selected></li> </ul> <p>More details can be found by consulting the <a href="http://www.w3.org/TR/xslt#section-HTML-Output-Method">W3C XSL Transformations (XSLT)</a> reference document.</p> <p class="warn">Though the HTMLSerializer goes a long way to helping create HTML output, it does not guarantee to create a fully conformant HTML document from whatever source it is fed. For example, if you specify the output should be strict HTML 4.01 and then your input contains: <img src="pic.jpg" align="right"/> the align attribute will still be output even though it is deprecated in strict HTML 4.01.</p> <h2>Configuration</h2> <p>By default an HTMLSerializer is assigned as 'html' and configured to produce HTML 4.01 'loose' which is also known as 'HTML 4.01 Transitional'. This doctype allows the use of both structural, semantic and presentational elements (e.g. font) but not framesets. Using the default serializer is as easy as adding the following to your sitemap:</p> <pre><map:pipeline id="demo"> <map:match pattern="*.html"> <map:generate src="page.xml"/> <strong><map:serialize type="html"/></strong> </map:match> </map:pipeline> </pre> <p>TO BE CONTINUED...</p> </body> </html>