[jdom-interest] Weird namespace attribute when using JAXP
listen at quimby.de
Fri Oct 22 09:27:17 PDT 2004
I want to serialize my JDOM documents using JDOMSource and a JAXP
identity transformer (the variant without stylesheet) because i need
HTML output (method = "html). Here is the output for a very simple
<?xml version="1.0" encoding="UTF-8"?>
I'm wondering, where the xmlns:="" attribute on the root element comes
from - i do not get this with an equivalent W3C document and DOMSource.
My code looks like this:
Document doc = new Document(new Element("html"));
TransformerFactory fact = TransformerFactory.newInstance();
Transformer tf = fact.newTransformer();
Source source = new JDOMSource(doc);
Result result = new StreamResult(System.out);
(note, that the "html" output method is not actually relevant. I get
the same result for "xml" output).
Does anybody have some insight where the namespace attribute is coming
from and how to get rid of it? This would be very much appreciated.
Another question: are there any alternatives for producing HTML from
More information about the jdom-interest