users@jaxb.java.net

enveloping an XML node inside another XML node

From: Carlos Gonzalez-Cadenas <carlos_at_gonzalez.name>
Date: Fri, 23 Mar 2007 18:09:10 +0100

Hi all,

For a concrete project, I have to envelope a XML signature (a ds:Signature)
as a child node of another node (that belongs to a container of a transport
protocol). I parse the XML Signature (that has its own namespace
declarations) from a file, unmarshal to JAXB and use the setter methods of
the parent container to set the XML Signature as a child.

The problem is that the marshaller rewrites all the namespace prefixes and
namespace declarations, changing the prefixes and moving the namespace nodes
to the root element of the combined document. As you can imagine, this
renders the XML Signature unusable.

Is there any way to do that with JAXB?

Many thanks in advance,

Carlos