stripnamespace.xslt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!-- this transform simply gets rid of the Cognos namespace -->
  13. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:x="x">
  14. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  15. <xsl:template match="/">
  16. <xsl:copy>
  17. <xsl:copy-of select="@*"/>
  18. <xsl:apply-templates/>
  19. </xsl:copy>
  20. </xsl:template>
  21. <xsl:template match="cm:namespace[cm:searchPath='CAMID(&quot;:&quot;)']" priority="2"/>
  22. <xsl:template match="node()" priority="0">
  23. <xsl:element name="{name()}" namespace="{namespace-uri()}">
  24. <xsl:copy-of select="@*"/>
  25. <xsl:apply-templates/>
  26. </xsl:element>
  27. </xsl:template>
  28. <xsl:template match="text()" priority="0">
  29. <xsl:copy-of select="."/>
  30. </xsl:template>
  31. </xsl:stylesheet>