I am relatively new at this but I have been reading the list and I've
tried to do my own leg work. But I need some help now. I want to
transform xml to another xml moving data to diff. tag names and
adding a namespace declaration to the root. I've read, searched and
done a lot of trial and error and here's where I am:
<xsl:element name="RRRRR" namespace="http://www.aaa.com/bbb/ccc">
<xsl:element name="TTT111">
<xsl:value-of select="concat(some source xml tags)"/>
</xsl:element>
<xsl:element name="TTT222">
<xsl:value-of select="concat(some source xml tags)"/>
</xsl:element>
<xsl:element name="TTT333">
<xsl:attribute name="AAA333">12345678</xsl:attribute>
<xsl:element name="TTT444">
<xsl:element name="TTT555">somedata</xsl:element>
<xsl:element name="TTT666">
<xsl:value-of select="a source xml tag"/>
</xsl:element>
I want a simple default namespace declaration on the root in the
output xml. The xsl:element for RRRR does that. But on all children
at the first level below RRRR it's generating xmlns="". So TTT222,
TTT333 get this xmlns="" in the output. I don't understand why
except it's clearing the namespace so they don't belong to the RRRR
namesspace. But the entire output xml should belong to the same
namespace. Seems like it's doing the opposite of what I intended and
thought it would do.
Could someone explain and enlighten me?
Thanks,
Ed
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list