- From: Julian Reschke <julian.reschke@gmx.de>
- Date: Tue, 02 Sep 2008 13:38:19 +0200
- To: HTML WG <public-html@w3.org>
Julian Reschke wrote:
> ...
>> I'd've thought exactly the opposite: "XSLT-compat" is somewhat
>> self-documenting, indicating that this is XSLT-compatible HTML. Whereas
>> "PUBLIC ''" is a cryptic bit of boilerplate with no obvious purpse --
>> which could therefore lead to the fears Henri mentioned, of people
>> thinking it's needed for reasons other than XSLT compatibility and
>> including it unnecessarily.
>
> 1) "XSLT-compat" is a bit misleading, because it may be relevant to
> other producers as well.
> ...
I just checked my last project where I needed to produce HTML from Java
-- turns out that it falls into the same category, as it uses
javax.xml.transform just for the purpose of serializing to HTML. Note
that this is *not* XSLT, just usage of a standard JDK method to produce
HTML.
So, which standard libraries do people use on other platforms (such as
.NET), and can *those* produce the HTML5 header?
BR, Julian
----- sample code -----
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class TestHtml5 {
public static void main(String[] args) throws
ParserConfigurationException, TransformerException {
Document doc =
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element html = doc.createElement("html");
doc.appendChild(html);
SAXTransformerFactory stf =
(SAXTransformerFactory)SAXTransformerFactory.newInstance();
Transformer t = stf.newTransformerHandler().getTransformer();
t.setOutputProperty(OutputKeys.METHOD, "html");
t.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "");
t.transform(new DOMSource(doc), new StreamResult(System.out));
}
}
Received on Tuesday, 2 September 2008 11:39:04 UTC