svn commit: r1412717 - /cocoon/branches/BRANCH_2_1_X/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java

[email protected]
Newsgroups gmane.text.xml.cocoon.cvs
Message-ID <[email protected]>
Author: cdamioli
Date: Thu Nov 22 23:45:56 2012
New Revision: 1412717

URL: http://svn.apache.org/viewvc?rev=1412717&view=rev
Log:
COCOON-2310  XHTMLSerializer from the serializers block does not handle HTML5 doctype 

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java?rev=1412717&r1=1412716&r2=1412717&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java Thu Nov 22 23:45:56 2012
@@ -49,6 +49,8 @@ import org.xml.sax.SAXException;
  *   <dd>The XHTML 1.0 Transitional document type.</dd> 
  *   <dt>"<code>frameset</code>"</dt>
  *   <dd>The XHTML 1.0 Frameset document type.</dd>
+ *   <dt>"<code>xhtml5</code>"</dt>
+ *   <dd>The XHTML5 document type.</dd>
  * </dl> 
  *
  * @version CVS $Id$
@@ -74,6 +76,9 @@ public class XHTMLSerializer extends XML
             "html", "-//W3C//DTD XHTML 1.0 Frameset//EN",
             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd");
 
+    /** A representation of the XHTML5 document type. */
+    public static final DocType XHTML5_DOCTYPE = new DocType("html");
+
     /* ====================================================================== */
 
     private static final XHTMLEncoder XHTML_ENCODER = new XHTMLEncoder();
@@ -130,6 +135,8 @@ public class XHTMLSerializer extends XML
             this.doctype_default = XHTML1_DOCTYPE_TRANSITIONAL;
         } else if ("frameset".equalsIgnoreCase(doctype)) {
             this.doctype_default = XHTML1_DOCTYPE_FRAMESET;
+        } else if ("xhtml5".equalsIgnoreCase(doctype)) {
+            this.doctype_default = XHTML5_DOCTYPE;
         } else {
             /* Default is transitional */
             this.doctype_default = XHTML1_DOCTYPE_TRANSITIONAL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.