A
Abs
Hi!
I need to build a HTML file using JAXP. Right now, I'm using the
following code:
---------
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
DOMImplementation impl = builder.getDOMImplementation();
DocumentType htmltype=impl.createDocumentType("html","-//W3C//DTD HTML
4.01 Transitional//EN","http://www.w3.org/TR/html4/loose.dtd");
Document doc = impl.createDocument("html", "html", htmltype);
// fill document
---------
The document is built correctly but the DOCTYPE tag doesn't appear. What
am I doing wrong ?
Thanks in advance
I need to build a HTML file using JAXP. Right now, I'm using the
following code:
---------
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
DOMImplementation impl = builder.getDOMImplementation();
DocumentType htmltype=impl.createDocumentType("html","-//W3C//DTD HTML
4.01 Transitional//EN","http://www.w3.org/TR/html4/loose.dtd");
Document doc = impl.createDocument("html", "html", htmltype);
// fill document
---------
The document is built correctly but the DOCTYPE tag doesn't appear. What
am I doing wrong ?
Thanks in advance