[jdom-interest] Weird namespace attribute when using
per.norrman at austers.se
Sat Oct 23 04:04:10 PDT 2004
Not sure what's happening, but when I use saxon I do not get the
Oliver Koell wrote:
> Hi all,
> 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"?>
> <html xmlns:=""></html>
> 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();
> tf.setOutputProperty(OutputKeys.METHOD, "html");
> Source source = new JDOMSource(doc);
> Result result = new StreamResult(System.out);
> tf.transform(source, result);
> (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
> JDOM documents?
> Regards, Oliver
> To control your jdom-interest membership:
More information about the jdom-interest