pre-process.xslt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. <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">
  13. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  14. <xsl:template match="*" priority="0">
  15. <xsl:copy>
  16. <xsl:copy-of select="@*"/>
  17. <xsl:apply-templates/>
  18. </xsl:copy>
  19. </xsl:template>
  20. <xsl:template match="object" priority="2"/>
  21. <xsl:template match="*[local-name()='policy' and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/']" priority="2">
  22. <xsl:if test="not(*[local-name()='deleted' and namespace-uri()='x'])">
  23. <xsl:element name="{name()}" namespace="{namespace-uri()}">
  24. <xsl:copy-of select="@*"/>
  25. <xsl:element name="securityObject" namespace="{namespace-uri()}">
  26. <xsl:element name="searchPath" namespace="{namespace-uri()}">
  27. <xsl:value-of select="*/*[local-name()='searchPath' and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/']"/>
  28. </xsl:element>
  29. </xsl:element>
  30. <xsl:apply-templates select="*[local-name()='permission' and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/']"/>
  31. </xsl:element>
  32. </xsl:if>
  33. </xsl:template>
  34. <xsl:template match="*[local-name()='permission' and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/']" priority="2">
  35. <xsl:copy-of select="."/>
  36. </xsl:template>
  37. <xsl:template match="text()" priority="0"/>
  38. </xsl:stylesheet>