cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <Robby.Pelss...@nxp.com>
Subject RE: HTML5 serializer
Date Fri, 06 Jan 2012 18:56:22 GMT
Hi Sylvain,

Thx for the pointer.

Using the same test but with some changes to the html5serializer

    public static XMLSerializer createHTML5Serializer() {
        XMLSerializer serializer = new XMLSerializer();

        serializer.setContentType(TEXT_HTML_UTF_8);
        serializer.setDoctypeSystem("about:legacy-compat");
        serializer.setEncoding(UTF_8);
        serializer.setMethod(HTML);

        return serializer;
    }

now results in
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>serializer test</title>
</head>
<body>
<p>test</p>
</body>
</html>

So we're almost there.   Do you have any suggestion how to accomplish using the correct <meta
charset="utf-8"/>  ??  Or do you think that's not worth the effort?

Robby

From: Sylvain Wallez [mailto:sylvain@apache.org]
Sent: Friday, January 06, 2012 6:13 PM
To: dev@cocoon.apache.org
Subject: Re: HTML5 serializer

Le 06/01/12 15:48, Robby Pelssers a écrit :
Hi all,

I've been looking at how to add a HTML5 serializer to the project.

So far my investigations have led to add following code to org.apache.cocoon.sax.component.XMLSerializer

    public static XMLSerializer createHTML5Serializer() {
        XMLSerializer serializer = new XMLSerializer();

        serializer.setContentType(TEXT_HTML_UTF_8);
        serializer.setDoctypePublic("XSLT-compat");

Looks like "XSLT-compat" has been changed to "about:legacy-compat"<about:legacy-compat>
in the latest HTML 5 specification.

See http://dev.w3.org/html5/spec/syntax.html#doctype-legacy-string

Sylvain



--

Sylvain Wallez - http://bluxte.net

Mime
View raw message