Advertisement
drkbl

XSLT change namespace

Feb 19th, 2022
1,299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.60 KB | None | 0 0
  1. <!-- Source: http://lists.xml.org/archives/xml-dev/201003/msg00090.html -->
  2. <xsl:stylesheet version="1.0"
  3.  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  4.   <xsl:output method="xml" />
  5.   <xsl:template
  6.    match="*[namespace-uri()='http://www.example.com/v30']">
  7.     <xsl:element name="{name()}"
  8.      namespace="http://www.example.com/v31";>
  9.       <xsl:copy-of select="@*"/>
  10.       <xsl:apply-templates/>
  11.     </xsl:element>
  12.   </xsl:template>
  13.   <xsl:template match="*">
  14.     <xsl:copy>
  15.       <xsl:copy-of select="@*"/>
  16.       <xsl:apply-templates/>
  17.     </xsl:copy>
  18.   </xsl:template>
  19. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement