I have the following input xml
Code:
<ProjectX>
<Agent_Class>xNETports</Agent_Class>
</ProjectX>
and I need this output xml
Code:
<ProjectX xmlns="http://www.mynamespace.com">
<Agent_Class>xNETports</Agent_Class>
</ProjectX>
I am using this xsl
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes"></xsl:output>
<xsl:template match="ProjectX">
<ProjectX xmlns="http://www.mynamespace.com">
<xsl:apply-templates select="@*|node()" />
</ProjectX>
</xsl:template>
<xsl:template match="*" >
<xsl:copy-of select="."></xsl:copy-of>
</xsl:template>
</xsl:stylesheet>
but i get the following xml instead
Code:
<ProjectX xmlns="http://www.mynamespace.com">
<Agent_Class xmlns="">xNETports</Agent_Class>
</ProjectX>
how do i remove the xmlns="" from the Agent_Class element??