1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (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:bind="urn:oasis:names:tc:wsrp:v1:bind"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtse="http://developer.cognos.com/schemas/xts/error/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <!--
- wsdl:definitions
- wsdl:service @name="WSDLService"
- wsdl:port
- soap:address @location
- - must have targetNamespace="urn:oasis:names:tc:wsrp:v1:wsdl"
- - must have wsdl:service name="WSRPService"
- - must have between 2 and 4 ports
- - must have wsdl:port name="WSRPBaseService"
- - must have wsdl:port name="WSRPServiceDescriptionService"
- - can have wsdl:port name="WSRPRegistrationService"
- - can have wsdl:port name="WSRPPortletManagementService"
- - must contain soap:address
- - soap:address @location must not be empty
- -->
- <xsl:variable name="wsrp-wsdl-ns">urn:oasis:names:tc:wsrp:v1:wsdl</xsl:variable>
- <xsl:variable name="wsrp-service" select="/wsdl:definitions/wsdl:service[@name = 'WSRPService']"/>
- <xsl:variable name="wsrp-markup" select="$wsrp-service/wsdl:port[@name = 'WSRPBaseService']"/>
- <xsl:variable name="wsrp-description" select="$wsrp-service/wsdl:port[@name = 'WSRPServiceDescriptionService']"/>
- <xsl:variable name="wsrp-registration" select="$wsrp-service/wsdl:port[@name = 'WSRPRegistrationService']"/>
- <xsl:variable name="wsrp-management" select="$wsrp-service/wsdl:port[@name = 'WSRPPortletManagementService']"/>
-
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="xtse:error">
- <xsl:copy-of select="xtse:error"/>
- </xsl:when>
- <xsl:when test="not($wsrp-service) or /wsdl:definitions/@targetNamespace != $wsrp-wsdl-ns">
- <error>
- <message><xts:string id="IDS_PAD_EDIT_ERROR_NOTWSRP"/></message>
- </error>
- </xsl:when>
- <xsl:when test="not($wsrp-markup) or $wsrp-markup/soap:address/@location = ''">
- <error>
- <message><xts:string id="IDS_PAD_EDIT_ERROR_MISSINGINTERFACES"/></message>
- </error>
- </xsl:when>
- <xsl:when test="not($wsrp-description) or $wsrp-description/soap:address/@location = ''">
- <error>
- <message><xts:string id="IDS_PAD_EDIT_ERROR_MISSINGINTERFACES"/></message>
- </error>
- </xsl:when>
- <xsl:when test="$wsrp-registration and ($wsrp-registration/soap:address/@location = '')">
- <error>
- <message><xts:string id="IDS_PAD_EDIT_ERROR_MISSINGINTERFACES"/></message>
- </error>
- </xsl:when>
- <xsl:when test="$wsrp-management and ($wsrp-management/soap:address/@location = '')">
- <error>
- <message><xts:string id="IDS_PAD_EDIT_ERROR_MISSINGINTERFACES"/></message>
- </error>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="wsdl:definitions"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|