title: Adjusting targetNamespace in XSL
body: <p>I have to create a translation document to rollback our newer message bodies. I was able to roll back the namespace with no issues but having issues rolling back the targetNamespace. </p>
  
  <p>In the java code the targetNamespace is set to new_namespace:1.1.0
  The incoming xml message looks like this.</p>
  
  <pre><code>&lt;env xmlns="original_cap_namespace" targetNamespace="new_namespace:1.1.0"&lt;/env&gt;
  </code></pre>
  
  <p>I want the outbound message to look like this(replace the cap namespace with the new_namespace and remove the versioning on the taretNamespace)</p>
  
  <pre><code>&lt;env xmlns="new_namespace" targetNamespace="new_namespace" &lt;/env&gt;
  </code></pre>
  
  <p>Here is what I tried. This works to replace the original_cap_namespace with the new_namespace. I cant seem to figure out how to strip the versioning from the targetNamespace or set the targetNamespace to the new_namespace just like the xmlns. I want the xmlns and the targetNamespace both to be set to the new_namespace. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="new_namespace"
  xmlns:cap="original_cap_namespace"
  exclude-result-prefixes="cap"&gt;
  &lt;xsl:output method="xml" indent="no" standalone="yes"/&gt;
  &lt;xsl:strip-space elements="*"/&gt;
  
  &lt;xsl:template match="/*[local-name()='env']"&gt;
      &lt;env xmlns="new_namespace"&gt;
          &lt;xsl:apply-templates select="@* | node()"/&gt;
      &lt;/env&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="@*"&gt;
      &lt;xsl:attribute name="{local-name()}"&gt;
          &lt;xsl:value-of select="."/&gt;
      &lt;/xsl:attribute&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="*"&gt;
      &lt;xsl:element name="{local-name()}"&gt;
           &lt;xsl:apply-templates select="@* | node()"/&gt;
      &lt;/xsl:element&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks a lot.</p>