0

My Xml File:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Response xmlns:responseservice="http://response.mywork.com">
        <ResponseRow xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <entityStatus>A</entityStatus>
                <bAResponse>
                <bAResponseRow>
                    <ABCD>U</ABCD>
                </bAResponseRow>
            </bAResponse>
        </ResponseRow>
    </Response>

My Xslt file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
<xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
<xsl:template match="Response" > 
        <xsl:element name="bbb" > 
            <xsl:for-each select="ResponseRow "> 
                <xsl:element name="bbbRow"> 
                    <xsl:apply-templates select="./node()"  /> 
                </xsl:element> 
            </xsl:for-each> 
        </xsl:element> 
    </xsl:template> 
    <xsl:template match="*"> 
        <xsl:element name="{local-name()}"> 
                        <xsl:apply-templates /> 
        </xsl:element> 
    </xsl:template> 
</xsl:stylesheet>

When I apply this xslt to my xml file for renaming the elements,the namespaces attached to the original xml goes away.Please suggest how to retain them.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253

0 Answers0