You may come across a situation where you want to replace one set of namespaces to another set. A typical example is that you have a pass-through OSB Service whose proxy is based on your Project’s namespaces and the underlying service is based on the out-of-the-box service namespaces.
In such cases, the following XSLT will search-replace the namespaces
For example, if your input xml looks like
..
..
..
..
..
..
..
..
..
and the response has to have a different set of namespaces,
..
..
..
..
..
..
..
..
..
The following XSLT works
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:myns1="http://www.w3.org/TR/html4/1"
xmlns:myns2="http://www.w3.org/TR/html4/2"
xmlns:myns3="http://www.w3.org/TR/html4/3"
xmlns:myns4="http://www.w3.org/TR/html4/4"
xmlns:myns5="http://www.w3schools.com/furniture"
xmlns:ns1="http://www.w3.org/TR/html4/1"
xmlns:ns2="http://www.w3.org/TR/html4/2"
xmlns:ns3="http://www.w3.org/TR/html4/3"
xmlns:ns4="http://www.w3.org/TR/html4/4"
xmlns:ns5="http://www.w3schools.com/furniture">
<xsl:template match="*">
<xsl:template match="ns2:*">
<xsl:element name="myns2:{local-name()}">
<xsl:template match="ns3:*">
<xsl:element name="myns3:{local-name()}">
<xsl:template match="ns4:*">
<xsl:element name="myns4:{local-name()}">
<xsl:template match="ns5:*">
<xsl:element name="myns5:{local-name()}">