12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <!--
- <xsl:template match="/root">
- <cogxFault>
- <xsl:copy-of select="fault"/>
- <xsl:apply-templates select="fault"/>
- </cogxFault>
- </xsl:template>
- -->
- <xsl:template match="/root">
- <xsl:apply-templates select="fault"/>
- </xsl:template>
- <xsl:template match="fault">
- <xsl:choose>
- <xsl:when test="xts:exception/xts:exceptionCode = 'request.connecterror'">
- <!-- these are the only cogx errors we should raise as errors -->
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="xts:exception" mode="root"/>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <!-- All other errors - pass up as part of the response and let the morphlet handle it -->
- <error><xsl:value-of select="xts:exception/xts:exceptionMsg"/></error>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="xts:exception" mode="root">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <bus:exception>
- <severity>error</severity>
- <errorCode>CCC-CGX-001</errorCode>
- <bus:message>
- <messageString><xts:string id="IDS_ERR_CGX_001"/></messageString>
- </bus:message>
- <bus:message>
- <messageString><xts:string id="IDS_ERR_CGX_002"><xts:param name="host"><xsl:value-of select="/root/system/param[@name='series7']/host"/></xts:param><xts:param name="port"><xsl:value-of select="/root/system/param[@name='series7']/port"/></xts:param></xts:string></messageString>
- </bus:message>
- <xsl:apply-templates select="descendant::bus:message | descendant::xts:exception"/>
- </bus:exception>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="xts:exception">
- <bus:message>
- <messageString><xsl:value-of select="xts:exceptionMsg"/></messageString>
- </bus:message>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|