addGUIDPolicies.xslt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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"
  13. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  14. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  15. exclude-result-prefixes=" xsl xtsext">
  16. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  17. <xsl:template match="/policies/*[local-name() = 'policy']">
  18. <xsl:element name="{local-name()}" namespace="{namespace-uri()}">
  19. <xsl:for-each select="*[local-name() != 'permission' and local-name() != 'added' and local-name() != 'deleted' and local-name() != 'changed']">
  20. <xsl:element name="{local-name()}" namespace="{namespace-uri()}">
  21. <xsl:copy-of select="@*"/>
  22. <xsl:copy-of select="*"/>
  23. <xsl:element name="guid" namespace="{namespace-uri()}">
  24. <xsl:value-of select="xtsext:generateGUID()"/>
  25. </xsl:element>
  26. </xsl:element>
  27. </xsl:for-each>
  28. <xsl:copy-of select="*[local-name() = 'permission' or local-name() = 'added' or local-name() = 'deleted' or local-name() = 'changed']"/>
  29. </xsl:element>
  30. </xsl:template>
  31. </xsl:stylesheet>