Hi Martin/mrame,
I tried the below sample but it still is not applying. I have pasted the stylesheet which I tried now.Pls let me know if I have done something wrong.Also I tried one more thing in the stylsheet you gave me it worked but it is giving antoher problem.
The XSL which martin gave me
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mc="http://www.comanyname.com/xmlschema/resource/metadata/oos/api/v002"
xmlns:osa="http://www.comanyname.com/xmlschema/resource/metadata/osa/infrastructure/v001"
xmlns:complex="http://www.company.com/xmlschema/resource/metadata/abc/complex/v002" exclude-result-prefixes="mc osa complex" version="1.0">
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="mc:RetrieveFutureTransactionV001">
<xsl:element name="{local-name()}" namespace="http://www.comanyname.com/xmlschema/resource/prabee/abc/api/v002">
<xsl:apply-templates select="@* | node()"></xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template match="mc:osaRequestHeader | mc:smControlDetail | mc:accountIdentifier | mc:partyID">
<xsl:element name="{local-name()}" namespace="http://holders.ppppp.app.esb.bac.com">
<xsl:apply-templates select="@* | node()"></xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template match="osa:*" mode="osa">
<xsl:element name="{name()}">
<xsl:apply-templates select="@* | node()" mode="osa"></xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template match="osa:*">
<xsl:element name="{name()}" namespace="http://complextypes.app.esb.bac.com">
<xsl:apply-templates select="@* | node()"></xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template match="complex:*">
<xsl:element name="{name()}" namespace="http://complextypes.app.esb.bac.com">
<xsl:apply-templates select="@* | node()"></xsl:apply-templates>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I have modified this XSL to remove the
exclude-result-prefixes="mc osa complex" and replace it with
exclude-result-prefixes="mc". I am getting the namespaces for osa:name and all the other sub elements. but for tag
Code:
<Retriev
xmlns="http://www.company.com/xmlschema/resource/metadata/abc/api/v002">
I am getting the following additional namespaces which I dont want.
Code:
<RetrieveFutureTransactionV001
xmlns:complex="http://www.company.com/xmlschema/resource/metadata/abc/complex/v002"
xmlns:osa="http://www.comanyname.com/xmlschema/resource/metadata/osa/infrastructure/v001"
xmlns="http://www.comanyname.com/xmlschema/resource/prabee/abc/api/v002">