error.xslt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  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. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  14. <xsl:template match="/">
  15. <fragment>
  16. <xsl:variable name="error" select="/root/error"/>
  17. <xsl:copy-of select="/root/fragment/info"/>
  18. <error>
  19. <xsl:choose>
  20. <xsl:when test="$error/code[.='nav:InvalidCredentials' or .='InvalidCredentialsFault']">
  21. <code>invalidCredentials</code>
  22. </xsl:when>
  23. <xsl:otherwise>
  24. <code>
  25. <xsl:value-of select="$error/code"/>
  26. </code>
  27. </xsl:otherwise>
  28. </xsl:choose>
  29. <xsl:copy-of select="$error/*[not(self::code)]"/>
  30. </error>
  31. </fragment>
  32. </xsl:template>
  33. </xsl:stylesheet>