Mucha, Dietrich RD-PN34 wrote:

Is there a solution for JAXP as well?
In transformer.setOutputProperty() I don't see something giving a similar effect to


        serializer.setNamespaces(true);
        serializer.serialize(doc);




It's not your fault. You're hitting a major design flaw in DOM. DOM requires you to both specify the namespaces for individual elements and attributes in a namespace *and* to add Attr objects to elements identifying the namespace declarations. Worse yet, there's nothing that keeps these two sources of namespace information in sync. :-(


If your documents are reasonably simple namespace wise, try adding the necessary xmlns and xmlns:prefix Attr objects to the document element. If different namespaces are in scope in different places, then it's a little trickier, but the solution is still to add Attr objects representing the xmlns attributes to the correct elements.

--
Elliotte Rusty Harold
[EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to