post-process-nil.xslt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  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:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" exclude-result-prefixes="xsd xsi bus">
  13. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  14. <xsl:template match="*[@xsi:nil!='' and local-name() != 'value']" priority="1">
  15. <xsl:copy>
  16. <xsl:copy-of select="@*[name() != 'xsi:nil']"/>
  17. <xsl:attribute name="nil"><xsl:value-of select="@xsi:nil"/></xsl:attribute>
  18. </xsl:copy>
  19. <!-- <xsl:element name="{name()}" namespace="{namespace-uri()}">
  20. <xsl:attribute name="nil"><xsl:value-of select="@xsi:nil"/></xsl:attribute>
  21. </xsl:element> -->
  22. <xsl:apply-templates/>
  23. </xsl:template>
  24. <xsl:template match="*">
  25. <xsl:copy>
  26. <xsl:copy-of select="@*"/>
  27. <xsl:apply-templates/>
  28. </xsl:copy>
  29. </xsl:template>
  30. </xsl:stylesheet>