View Single Post
  #4 (permalink)  
Old January 14th, 2009, 12:25 PM
Martin Honnen Martin Honnen is offline
Friend of Wrox
Points: 3,131, Level: 23
Points: 3,131, Level: 23 Points: 3,131, Level: 23 Points: 3,131, Level: 23
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Nov 2007
Location: Germany
Posts: 655
Thanks: 0
Thanked 98 Times in 97 Posts
Default

Here is an XSLT 1.0 stylesheet that does the trick here for me (tested with Saxon 6.5.5):
Code:
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:icns="urn:NewBusiness_ABC"
  version="1.0">
  
  <xsl:template match="@* | text() | comment() | processing-instruction()">
    <xsl:copy/>
  </xsl:template>
  
  <xsl:template match="*">
    <xsl:element name="{name()}" namespace="{namespace-uri()}">
      <xsl:copy-of select="document('')/xsl:stylesheet/namespace::*[local-name() = 'icns']"/>
      <xsl:copy-of select="namespace::*[not(local-name() = 'icns')]"/>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>
__________________
Martin Honnen
Microsoft MVP - XML
My blog
Reply With Quote