Description
There's idiomatic XSLT copy transformation:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> </xsl:stylesheet>
Using current org.apache.cxf.staxutils.StaxSource for such transformation applied on this input document:
<root xmlns="urn:org.apache.cxf:test">Text</root>
produces the following result with Xalan 2.7.1:
< xmlns="urn:org.apache.cxf:test">Text</>
After getting rid of the hack commented with:
// Adding namespace declaration as attributes is necessary because // the xalan implementation that ships with SUN JDK 1.4 is bugged // and does not handle the startPrefixMapping method
And using correct order of events:
- start prefix mapping
- start element
- end element
- end prefix mapping
The result was correct on both:
- Xalan 2.7.1
- JDK 1.6.0_04 (and laters)
JDK 1.6.0_04 is the first JDK that ships with JAX-WS 2.1 which seem to be required by CXF.
regards
Grzegorz Grzybek