home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / html-serializer.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  9.9 KB  |  247 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
  18.  
  19. <document>
  20.   <header>
  21.     <title>HTML Serializer</title>
  22.     <version>0.9</version>
  23.     <type>Technical document</type>
  24.     <authors>
  25.       <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
  26.       <person name="Bernhard Huber" email="huber@apache.org"/>
  27.      </authors>
  28.      <abstract>This document describes the html serializer of Cocoon.</abstract>
  29.   </header>
  30.   <body>
  31.     <s1 title="HTML Serializer">
  32.       <p>
  33.         The HTML serializer serializes xml content to html.
  34.         It is the default serializer.
  35.       </p>
  36.       <ul>
  37.         <li>Name : html</li>
  38.         <li>Class: org.apache.cocoon.serialization.HtmlSerializer</li>
  39.         <li>Cacheable: yes.</li>
  40.       </ul>
  41.       <s2 title="Sitemap Configuration">
  42.         <p>
  43.           The HTML Serializer is declared in the sitemap serializers section.
  44.         </p>
  45.         <source><![CDATA[
  46. <map:serializers default="html">
  47. ...
  48.   <map:serializer name="html"
  49.     src="org.apache.cocoon.serialization.HTMLSerializer"
  50.     mime-type="text/html"  
  51.     logger="sitemap.serializer.html" 
  52.     pool-grow="4" pool-max="32" pool-min="4">
  53.     <!-- serializer configurations -->
  54. ...    
  55.   </map:serializer>
  56. ...
  57.         ]]></source>
  58.         <p>
  59.           HTML Serializer can be configured, specifying elements inside of
  60.           the <map:serializer> body.
  61.         </p>
  62.         <s3 title="Configuration Example">
  63.           <p>
  64.             The following HTML Serializer snippet is setting
  65.             doctype, and encoding configuration for the HTML Serializer
  66.           </p>
  67.           <source><![CDATA[
  68. <map:serializer name="html"         
  69.   src="org.apache.cocoon.serialization.HTMLSerializer"
  70.   mime-type="text/html">
  71.   <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
  72.   <encoding>ISO-8859-1</encoding>
  73. </map:serializer>
  74.           ]]></source>
  75.           <p>
  76.             This configuration will result in HTML output of the form
  77.           </p>
  78.           <source><![CDATA[
  79. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  80. <html>
  81. <head>
  82. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  83. <title...
  84. ...
  85.           ]]></source>
  86.         </s3>
  87.         <p>
  88.           The HTML Serializer accepts following configuration parameters.
  89.           These configurations are not Xalan specific.
  90.         </p>
  91. <!--
  92. # XSLT properties do not need namespace qualification.
  93. method=xml
  94. indent=yes
  95. media-type=text/html
  96. version=4.0
  97.  
  98. # Xalan-specific output properties.  These can be overridden in the stylesheet 
  99. # assigning a xalan namespace.  For example:
  100. # <xsl:stylesheet version="1.0"
  101. #          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  102. #          xmlns:xalan="http://xml.apache.org/xslt">
  103. #  <xsl:output method="html" encoding="UTF-8"
  104. #              xalan:content-handler="MyContentHandler"/>
  105. #  ...
  106. # Note that the colon after the protocol needs to be escaped.
  107. {http\u003a//xml.apache.org/xslt}indent-amount=0
  108. {http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToHTML
  109. {http\u003a//xml.apache.org/xslt}entities=HTMLEntities.res
  110. {http\u003a//xml.apache.org/xslt}use-url-escaping=yes
  111. -->
  112.         <table>
  113.           <tr><th>Name</th><th>Xalan Default Value</th><th>Comment</th></tr>
  114.           <tr><td>cdata-section-elements</td>
  115.             <td>none</td>
  116.             <td><code>cdata-section-elements</code> specifies a whitespace delimited
  117.                list of the names of elements whose text node children should be output
  118.                using CDATA sections.
  119.                See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation.</link>
  120.             </td>
  121.           </tr>
  122.           <tr><td>doctype-public</td>
  123.             <td>none</td>
  124.             <td><code>doctype-public</code> specifies the public identifier
  125.               to be used in the document type declaration.
  126.             </td>
  127.           </tr>
  128.           <tr><td>doctype-system</td>
  129.             <td>none</td>
  130.             <td>
  131.               <code>doctype-system</code> specifies the system identifier
  132.               to be used in the document type declaration.
  133.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  134.             </td>
  135.           </tr>
  136.           <tr><td>encoding</td>
  137.             <td>none</td>
  138.             <td><code>encoding</code> specifies the preferred character
  139.               encoding that the Transformer should use to encode sequences of
  140.               characters as sequences of bytes. The value of the attribute should be
  141.               treated case-insensitively. The value must only contain characters in
  142.               the range #x21 to #x7E (i.e., printable ASCII characters). The value
  143.               should either be a <code>charset</code> registered with the Internet
  144.               Assigned Numbers Authority <link href="#IANA">[IANA]</link>,
  145.               <link href="#RFC2278">[RFC2278]</link> or start with <code>X-</code>.
  146.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  147.             </td>
  148.           </tr>
  149.           <tr><td>indent</td>
  150.             <td>
  151.               yes
  152.             </td>
  153.             <td>
  154.               A Flag for toggling indent. This flag toggles only if some elements
  155.               should trigger a line break.
  156.             </td>
  157.           </tr>
  158.           <tr><td>media-type</td>
  159.             <td>
  160.             </td>
  161.             <td>
  162.               <code>media-type</code> specifies the media type (MIME
  163.               content type) of the data that results from outputting the result
  164.               tree. The <code>charset</code> parameter should not be specified
  165.               explicitly; instead, when the top-level media type is
  166.               <code>text</code>, a <code>charset</code> parameter should be added
  167.               according to the character encoding actually used by the output
  168.               method.
  169.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  170.             </td>
  171.           </tr>
  172.           <tr><td>method</td>
  173.             <td>
  174.             </td>
  175.             <td>
  176.               The method attribute identifies the overall method that
  177.               should be used for outputting the result tree.  Other non-namespaced
  178.               values may be used, such as "xhtml", but, if accepted, the handling
  179.               of such values is implementation defined.  If any of the method values
  180.               are not accepted and are not namespace qualified,
  181.               then {@link javax.xml.transform.Transformer#setOutputProperty}
  182.               or {@link javax.xml.transform.Transformer#setOutputProperties} will
  183.               throw a {@link java.lang.IllegalArgumentException}.
  184.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  185.             </td>
  186.           </tr>
  187.           <tr><td>omit-xml-declaration</td>
  188.             <td></td>
  189.             <td>
  190.               <code>omit-xml-declaration</code> specifies whether the XSLT
  191.               processor should output an XML declaration; the value must be
  192.               <code>yes</code> or <code>no</code>.
  193.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  194.             </td>
  195.           </tr>
  196.           <tr><td>standalone</td>
  197.             <td></td>
  198.             <td>
  199.               <code>standalone</code> specifies whether the Transformer
  200.               should output a standalone document declaration; the value must be
  201.               <code>yes</code> or <code>no</code>.
  202.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  203.             </td>
  204.           </tr>
  205.           <tr><td>version</td>
  206.             <td>
  207.             </td>
  208.             <td>
  209.               <code>version</code> specifies the version of the output
  210.               method.
  211.               When the output method is "xml", the version value specifies the
  212.               version of XML to be used for outputting the result tree. The default
  213.               value for the xml output method is 1.0. When the output method is
  214.               "html", the version value indicates the version of the HTML.
  215.               The default value for the xml output method is 4.0, which specifies
  216.               that the result should be output as HTML conforming to the HTML 4.0
  217.               Recommendation [HTML].  If the output method is "text", the version
  218.               property is ignored.
  219.               See <link href="http://www.w3.org/TR/xslt#output">section 16 of the XSL Transformations (XSLT) W3C Recommendation</link>
  220.             </td>
  221.           </tr>
  222.         </table>
  223.         <note>
  224.           Former property <code>buffer-size</code> is deprecated, and is ignored.
  225.         </note>
  226.         <p>
  227.           The HTML Serializer sets the <code>method</code> property
  228.           to <code>html</code>.
  229.         </p>
  230.       </s2>
  231.       <s2 title="Pipeline Usage">
  232.       <source><![CDATA[
  233. ...
  234. <map:match pattern="*.html">
  235. <map:generate...
  236. ...
  237. <map:serialize type="html"/>
  238. ...
  239.       ]]></source>
  240.       </s2>
  241.       <s2 title="Further Reading">
  242.       </s2>
  243.     </s1>
  244.   </body>
  245. </document>
  246.  
  247.