2002/ws/desc/test-suite/results-messages evaluate-html-log-xsl.xslt,NONE,1.1 generate-message-properties.xslt,NONE,1.1 ws-i.xslt,NONE,1.1 generate-xpath-assertions.xslt,1.2,1.3 build.xml,1.3,1.4

Update of /sources/public/2002/ws/desc/test-suite/results-messages
In directory hutz:/tmp/cvs-serv8052

Modified Files:
	generate-xpath-assertions.xslt build.xml 
Added Files:
	evaluate-html-log-xsl.xslt generate-message-properties.xslt 
	ws-i.xslt 
Log Message:
New message evaluate

--- NEW FILE: ws-i.xslt ---
<?xml version="1.0" encoding="UTF-8"?>
<!--

    $Header: /sources/public/2002/ws/desc/test-suite/results-messages/ws-i.xslt,v 1.1 2006/11/18 10:22:44 plehegar Exp $

    Convert WS-I Monitor file into WS-Addressing Log file

-->
<xsl:stylesheet version="1.0"
		xmlns="http://www.w3.org/2002/ws/desc/logs/"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:wsi-log303="http://www.ws-i.org/testing/2003/03/log/"
		xmlns:wsi-log407="http://www.ws-i.org/testing/2004/07/log/"
		exclude-result-prefixes='wsi-log303 wsi-log407'>
	<xsl:output method="xml" indent="yes"/>
	<xsl:variable name="bom">&lt;?xml</xsl:variable>
	<xsl:variable name="gone">&lt;?_xml</xsl:variable>
	<xsl:template match="wsi-log303:log">
		<log xmlns:l="http://www.w3.org/2002/ws/addressing/logs/">
			<xsl:for-each select="//wsi-log303:messageEntry">
				<xsl:variable name="content">
				  <xsl:variable name="fixed_content">
				    <xsl:choose>
				      <xsl:when test='contains(wsi-log303:httpHeaders, "&lt;?xml")
						      and contains(wsi-log303:messageContent, "&lt;?xml")'>
					<xsl:text>&lt;?xml</xsl:text>
					<xsl:value-of select="substring-after(wsi-log303:messageContent, '&lt;?xml')"/>
				      </xsl:when>
				      <xsl:otherwise>
					<xsl:value-of select="wsi-log303:messageContent"/>
				      </xsl:otherwise>
				    </xsl:choose>
				  </xsl:variable>
				  <xsl:choose>
				    <xsl:when test='contains(wsi-log303:httpHeaders, "Content-Type: text/xml")
						    or contains(wsi-log303:httpHeaders, "Content-Type: application/soap+xml")'>
					<xsl:call-template name="replaceContent">
						<xsl:with-param name="text" select="$fixed_content"/>
						<xsl:with-param name="replace" select="$bom"/>
						<xsl:with-param name="with" select="$gone"/>
						<xsl:with-param name="disable-output-escaping" select="yes"/>
					</xsl:call-template>
				    </xsl:when>
				    <xsl:otherwise>
				      <xsl:value-of select="$fixed_content"/>
				    </xsl:otherwise>
				  </xsl:choose>
				</xsl:variable>
				<message timestamp="{@timestamp}" conversation="{@conversationID}" number="{@ID}" type="{@type}">
				  <senderHostAndPort>
				    <xsl:copy-of select="wsi-log303:senderHostAndPort/@*"/>
				    <xsl:copy-of select="wsi-log303:senderHostAndPort/*|wsi-log303:senderHostAndPort/text()"/>
				  </senderHostAndPort>
				  <receiverHostAndPort>
				    <xsl:copy-of select="wsi-log303:receiverHostAndPort/@*"/>
				    <xsl:copy-of select="wsi-log303:receiverHostAndPort/*|wsi-log303:receiverHostAndPort/text()"/>
				  </receiverHostAndPort>
				  <httpHeaders>
				    <xsl:call-template name='replaceHeaders'>
				      <xsl:with-param name="text">
					<xsl:choose>
					  <xsl:when test='contains(wsi-log303:httpHeaders, "&lt;?xml")
							  and contains(wsi-log303:messageContent, "&lt;?xml")'>
					    <xsl:value-of select="substring-before(wsi-log303:httpHeaders, '&lt;?xml')"/>
					  </xsl:when>
					  <xsl:otherwise>
					    <xsl:value-of select="wsi-log303:httpHeaders"/>
					  </xsl:otherwise>
					</xsl:choose>
				      </xsl:with-param>
				    </xsl:call-template>
				  </httpHeaders>
				  <content>
				    <xsl:choose>
				      <xsl:when test='contains($content, "&lt;!DOCTYPE")'>					
					<xsl:value-of select="$content" />
				      </xsl:when>
				      <xsl:otherwise>
					<xsl:value-of select="$content" disable-output-escaping="yes"/>
				      </xsl:otherwise>
				    </xsl:choose>
				  </content>
				</message>
			</xsl:for-each>
		</log>
	</xsl:template>
	<xsl:template match="wsi-log407:log">
		<log>
			<xsl:for-each select="//wsi-log407:messageEntry">
				<xsl:variable name="content">
				  <xsl:variable name="fixed_content">
				    <xsl:choose>
				      <xsl:when test='contains(wsi-log407:httpHeaders, "&lt;?xml")
						      and contains(wsi-log407:messageContent, "&lt;?xml")'>
					<xsl:text>&lt;?xml</xsl:text>
					<xsl:value-of select="substring-after(wsi-log407:messageContent, '&lt;?xml')"/>
				      </xsl:when>
				      <xsl:otherwise>
					<xsl:value-of select="wsi-log407:messageContent"/>
				      </xsl:otherwise>
				    </xsl:choose>
				  </xsl:variable>
				  <xsl:choose>
				    <xsl:when test='contains(wsi-log407:httpHeaders, "Content-Type: text/xml")
						    or contains(wsi-log407:httpHeaders, "Content-Type: application/soap+xml")'>
					<xsl:call-template name="replaceContent">
						<xsl:with-param name="text" select="wsi-log407:messageContent"/>
						<xsl:with-param name="replace" select="$bom"/>
						<xsl:with-param name="with" select="$gone"/>
						<xsl:with-param name="disable-output-escaping" select="yes"/>
					</xsl:call-template>
				    </xsl:when>
				    <xsl:otherwise>
				      <xsl:value-of select="wsi-log407:messageContent"/>
				    </xsl:otherwise>
				  </xsl:choose>
				</xsl:variable>
				<message timestamp="{@timestamp}" conversation="{@conversationID}" number="{@ID}" type="{@type}">
				  <senderHostAndPort>
				    <xsl:copy-of select="wsi-log407:senderHostAndPort/@*"/>
				    <xsl:copy-of select="wsi-log407:senderHostAndPort/*|wsi-log407:senderHostAndPort/text()"/>
				  </senderHostAndPort>
				  <receiverHostAndPort>
				    <xsl:copy-of select="wsi-log407:receiverHostAndPort/@*"/>
				    <xsl:copy-of select="wsi-log407:receiverHostAndPort/*|wsi-log407:receiverHostAndPort/text()"/>
				  </receiverHostAndPort>
				  <httpHeaders>
				    <xsl:call-template name='replaceHeaders'>
				      <xsl:with-param name="text">
					<xsl:choose>
					  <xsl:when test='contains(wsi-log407:httpHeaders, "&lt;?xml")
							  and contains(wsi-log407:messageContent, "&lt;?xml")'>
					    <xsl:value-of select="substring-before(wsi-log407:httpHeaders, '&lt;?xml')"/>
					  </xsl:when>
					  <xsl:otherwise>
					    <xsl:value-of select="wsi-log407:httpHeaders"/>
					  </xsl:otherwise>
					</xsl:choose>
				      </xsl:with-param>
				    </xsl:call-template>
				  </httpHeaders>
				  <content>
				    <xsl:choose>
				      <xsl:when test='contains($content, "&lt;!DOCTYPE")'>					
					<xsl:value-of select="$content" />
				      </xsl:when>
				      <xsl:otherwise>
					<xsl:value-of select="$content" disable-output-escaping="yes"/>
				      </xsl:otherwise>
				    </xsl:choose>
				  </content>
				</message>
			</xsl:for-each>
		</log>
	</xsl:template>

	<xsl:template name="replaceHeaders">
	  <xsl:param name='text'/>

	  <xsl:choose>
	    <xsl:when test='contains($text, "&#xD;")'>
	      <xsl:call-template name='replaceHeaders'>
		<xsl:with-param name='text' select='substring-before($text, "&#xD;")'/>
	      </xsl:call-template>
	      <xsl:call-template name='replaceHeaders'>
		<xsl:with-param name='text' select='substring-after($text, "&#xD;")'/>
	      </xsl:call-template>
	    </xsl:when>
	    <xsl:when test='starts-with($text, "HTTP/1.")'>
	      <StatusCode value='{substring-before(substring-after($text, " "), " ")}'>
		<xsl:value-of select='$text'/>
	      </StatusCode>
	    </xsl:when>
	    <xsl:when test='starts-with($text, "POST ")'>
	      <Method value="POST">
		<xsl:call-template name='replaceURI'>
		  <xsl:with-param name='text' select='substring-before(substring-after($text, "POST "), " HTTP")'/>
		</xsl:call-template>
	      </Method>
	    </xsl:when>
	    <xsl:when test='starts-with($text, "PUT ")'>
	      <Method value="PUT">
		<xsl:call-template name='replaceURI'>
		  <xsl:with-param name='text' select='substring-before(substring-after($text, "PUT "), " HTTP")'/>
		</xsl:call-template>
	      </Method>
	    </xsl:when>
	    <xsl:when test='starts-with($text, "GET ")'>
	      <Method value="GET">
		<xsl:call-template name='replaceURI'>
		  <xsl:with-param name='text' select='substring-before(substring-after($text, "GET "), " HTTP")'/>
		</xsl:call-template>
	      </Method>
	    </xsl:when>
	    <xsl:when test='starts-with($text, "DELETE ")'>
	      <Method value="DELETE">
		<xsl:call-template name='replaceURI'>
		  <xsl:with-param name='text' select='substring-before(substring-after($text, "DELETE "), " HTTP")'/>
		</xsl:call-template>
	      </Method>
	    </xsl:when>
	    <xsl:when test='contains($text, ": ")'>
	      <xsl:variable name='name'>
		<xsl:value-of select='substring-before(normalize-space($text), ": ")'/>
	      </xsl:variable>
	      <xsl:element name='{$name}'>
		<xsl:variable name='content' select='substring-after($text, ": ")'/>
		<xsl:choose>
		  <xsl:when test='$name="Content-Type"'>
		    <xsl:call-template name='replaceContentType'>
		      <xsl:with-param name='text' select='$content' />
		    </xsl:call-template>
		  </xsl:when>
		  <xsl:otherwise>
		    <xsl:value-of select='$content'/>
		  </xsl:otherwise>
		</xsl:choose>
	      </xsl:element>
	    </xsl:when>
	    <xsl:otherwise>
	      <xsl:value-of select='$text' disable-output-escaping="yes"/>
	    </xsl:otherwise>
	  </xsl:choose>

	</xsl:template>

	<xsl:template name="replaceURI">
	  <xsl:param name='text'/>

	  <xsl:choose>
	    <xsl:when test='contains($text, "?")'>
	      <uri><xsl:value-of select='substring-before($text, "?")'/></uri>
	      <xsl:call-template name='replaceParams'>
		<xsl:with-param name='text' select='substring-after($text, "?")'/>
		<xsl:with-param name='sep'>&amp;</xsl:with-param>
	      </xsl:call-template>
	    </xsl:when>
	    <xsl:otherwise>
	      <uri><xsl:value-of select='$text'/></uri>
	    </xsl:otherwise>
	  </xsl:choose>
	</xsl:template>

	<xsl:template name="replaceContentType">
	  <xsl:param name='text'/>

	  <xsl:choose>
	    <xsl:when test='contains($text, ";")'>
	      <xsl:attribute name="type"><xsl:value-of select='substring-before($text, ";")'/></xsl:attribute>
	      <xsl:call-template name='replaceParams'>
		<xsl:with-param name='text' select='substring-after($text, ";")'/>
		<xsl:with-param name='sep'>;</xsl:with-param>
	      </xsl:call-template>
	    </xsl:when>
	    <xsl:otherwise>
	      <xsl:attribute name="type"><xsl:value-of select='$text'/></xsl:attribute>
	    </xsl:otherwise>
	  </xsl:choose>
	</xsl:template>

	<xsl:template name="replaceParams">
	  <xsl:param name='text'/>
	  <xsl:param name='sep'/>

	  <xsl:choose>
	    <xsl:when test='contains($text, $sep)'>
	      <xsl:call-template name='replaceParams'>
		<xsl:with-param name='text' select='substring-before($text, $sep)'/>
		<xsl:with-param name='sep' select='$sep' />
	      </xsl:call-template>
	      <xsl:call-template name='replaceParams'>
		<xsl:with-param name='text' select='substring-after($text, $sep)'/>
		<xsl:with-param name='sep' select='$sep' />
	      </xsl:call-template>
	    </xsl:when>
	    <xsl:when test='contains($text, "=")'>
	      <xsl:element name='{normalize-space(substring-before($text, "="))}'>
		<xsl:variable name='value' select='substring-after($text, "=")'/>
		<xsl:choose>
		  <xsl:when test="starts-with($value, '&quot;') and substring($value, string-length($value), 1)">
		    <!-- remove quotes out of the value -->
		    <xsl:value-of select='substring($value, 2, string-length($value)-2)'/>
		  </xsl:when>
		  <xsl:otherwise><xsl:value-of select='$value'/></xsl:otherwise>
		</xsl:choose>
	      </xsl:element>
	    </xsl:when>
	  </xsl:choose>

	</xsl:template>

	<!-- http://xsltsl.sourceforge.net/ -->
	<xsl:template name="replaceContent">
		<xsl:param name="text"/>
		<xsl:param name="replace"/>
		<xsl:param name="with"/>
		<xsl:param name="disable-output-escaping">no</xsl:param>
		<xsl:choose>
			<xsl:when test="string-length($replace) = 0 and $disable-output-escaping = 'yes'">
				<xsl:value-of select="$text" disable-output-escaping="yes"/>
			</xsl:when>
			<xsl:when test="string-length($replace) = 0">
				<xsl:value-of select="$text"/>
			</xsl:when>
			<xsl:when test="contains($text, $replace)">
				<xsl:variable name="before" select="substring-before($text, $replace)"/>
				<xsl:variable name="after" select="substring-after($text, $replace)"/>
				<xsl:choose>
					<xsl:when test='$disable-output-escaping = "yes"'>
						<xsl:value-of select="$before" disable-output-escaping="yes"/>
						<xsl:value-of select="$with" disable-output-escaping="yes"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$before"/>
						<xsl:value-of select="$with"/>
					</xsl:otherwise>
				</xsl:choose>
				<xsl:call-template name="replaceContent">
					<xsl:with-param name="text" select="$after"/>
					<xsl:with-param name="replace" select="$replace"/>
					<xsl:with-param name="with" select="$with"/>
					<xsl:with-param name="disable-output-escaping" select="$disable-output-escaping"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:when test='$disable-output-escaping = "yes"'>
				<xsl:value-of select="$text" disable-output-escaping="yes"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$text"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>

--- NEW FILE: generate-message-properties.xslt ---
<?xml version="1.0" encoding="utf-8"?>
<!--

    $Header: /sources/public/2002/ws/desc/test-suite/results-messages/generate-message-properties.xslt,v 1.1 2006/11/18 10:22:44 plehegar Exp $

    Convert WSDL Component model into message properties

-->
<xsl:stylesheet version="1.0"
		xmlns="http://www.w3.org/2006/11/desc/messages"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:cm='http://www.w3.org/2002/ws/desc/wsdl/component'
		xmlns:cmextensions='http://www.w3.org/2002/ws/desc/wsdl/component-extensions'
		xmlns:cmbase='http://www.w3.org/2002/ws/desc/wsdl/component-base'
		xmlns:cmhttp='http://www.w3.org/2002/ws/desc/wsdl/component-http'
		xmlns:cmrpc='http://www.w3.org/2002/ws/desc/wsdl/component-rpc'
		xmlns:cmsoap='http://www.w3.org/2002/ws/desc/wsdl/component-soap'
		exclude-result-prefixes='cmsoap cmrpc cmhttp cmbase cmextensions cm'>

  <xsl:output method="xml" indent="yes" />

  <xsl:key name='xmlId' match='*' use='@xml:id'/>

  <xsl:template match='/'>
    <messages>
      <xsl:call-template name='process-endpointComponents'>
	<xsl:with-param name='endpointComponents' select='/cm:descriptionComponent/cm:services/cm:serviceComponent/cm:endpoints/cm:endpointComponent'/>
	<xsl:with-param name='start'>0</xsl:with-param>
      </xsl:call-template>
    </messages>
  </xsl:template>

  <!-- Process a list of endpoint components -->
  <xsl:template name='process-endpointComponents'>
    <xsl:param name='endpointComponents'/>
    <!-- how many operations processed before this endpoint component list? -->
    <xsl:param name='start'/>


    <xsl:if test='count($endpointComponents) != 0'>

      <!-- process the first element of the list -->
      <xsl:call-template name='process-endpointComponent'>
	<xsl:with-param name='endpointComponent' select='$endpointComponents[position()=1]'/>
	<xsl:with-param name='start' select='$start'/>
      </xsl:call-template>

      <!-- count how many operations are attached to the endpoint -->
      <xsl:variable name='current'>
	<xsl:call-template name='count-messages-in-interfaceReferences'>
	  <xsl:with-param name='interfaceReferences'
			  select='$endpointComponents[position()=1]/ancestor::cm:serviceComponent/cm:interface'/>
	</xsl:call-template>
      </xsl:variable>

      <!-- process the remainder of the list -->
      <xsl:call-template name='process-endpointComponents'>
	<xsl:with-param name='endpointComponents' select='$endpointComponents[position()>1]'/>
	<xsl:with-param name='start' select='$start + $current'/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name='process-endpointComponent'>
    <xsl:param name='endpointComponent' />
    <xsl:param name='start' />



    <xsl:call-template name='process-interfaceReferences'>
      <xsl:with-param name='interfaceReferences'
		      select='$endpointComponent/ancestor::cm:serviceComponent/cm:interface'/>
      <xsl:with-param name='endpointComponent'
		      select='$endpointComponent'/>
      <xsl:with-param name='start' select='$start'/>
    </xsl:call-template>
    
  </xsl:template>

  <!-- Process each interface operation component for a given list of interface[@ref] -->
  <xsl:template name='process-interfaceReferences'>
    <!-- list of interface[@ref] -->
    <xsl:param name='interfaceReferences' />
    <xsl:param name='endpointComponent' />
    <xsl:param name='start' />
    
    <xsl:choose>
      <xsl:when test='count($interfaceReferences) = 0'>
      </xsl:when>
      <xsl:otherwise>
	<xsl:variable name='interfaceComponent'
		      select='key("xmlId", $interfaceReferences[position()=1]/@ref)' />

	<xsl:variable name='extended'>
	  <xsl:call-template name='count-messages-in-interfaceReferences'>
	    <xsl:with-param name='interfaceReferences' select='$interfaceComponent/cm:extendedInterfaces/cm:interface'/>
	  </xsl:call-template>
	</xsl:variable>

	<xsl:variable name='current'>
	  <xsl:call-template name='count-messages-in-interfaceOperationComponents'>
	    <xsl:with-param name='interfaceOperationComponents'
			    select='$interfaceComponent/cm:interfaceOperations/cm:interfaceOperationComponent'/>
	  </xsl:call-template>
	</xsl:variable>

	<xsl:call-template name='process-interfaceReferences'>
	  <xsl:with-param name='interfaceReferences' select='$interfaceComponent/cm:extendedInterfaces/cm:interface'/>
	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
	  <xsl:with-param name='start' select='$start' />
	</xsl:call-template>
	
	<xsl:call-template name='process-interfaceOperationComponents'>
	  <xsl:with-param name='interfaceOperationComponents'
			  select='$interfaceComponent/cm:interfaceOperations/cm:interfaceOperationComponent'/>
	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
	  <xsl:with-param name='start' select='$start + $extended' />
	</xsl:call-template>

	<xsl:call-template name='process-interfaceReferences'>
	  <xsl:with-param name='interfaceReferences' select='$interfaceReferences[position()>1]'/>
	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
	  <xsl:with-param name='start' select='$start + $extended + $current' />
	</xsl:call-template>

      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name='process-interfaceOperationComponents'>
    <xsl:param name='interfaceOperationComponents' />
    <xsl:param name='endpointComponent' />
    <xsl:param name='start' />

    <xsl:variable name='interfaceOperationComponent'
		  select='$interfaceOperationComponents[position()=1]'/>
    <xsl:variable name='mep' select='$interfaceOperationComponent/cm:messageExchangePattern'/>

    <!-- Process the input message -->
    <message>
      <xsl:call-template name='process-interfaceMessageReferenceComponent'>
	<xsl:with-param name='interfaceMessageReferenceComponent'
			select='$interfaceOperationComponent/cm:interfaceMessageReferences/cm:interfaceMessageReferenceComponent[cm:direction="in"]' />
	<xsl:with-param name='endpointComponent' select='$endpointComponent' />
	<xsl:with-param name='position' select='$start + 1' />
      </xsl:call-template>
    </message>

    <!-- Process the output or fault message -->    
    <message>
      <xsl:choose>
	<xsl:when test='contains($interfaceOperationComponent/cm:name/cmbase:localName, "Fault")'>
	  <!-- We have a fault message to process. @@Could have more than one.. -->
	  <xsl:call-template name='process-interfaceFaultReferenceComponent'>
	    <xsl:with-param name='interfaceFaultReferenceComponent'
			    select='$interfaceOperationComponent/cm:interfaceFaultReferences/cm:interfaceFaultReferenceComponent[cm:direction="out"]' />
	    <xsl:with-param name='endpointComponent' select='$endpointComponent' />
	    <xsl:with-param name='position' select='$start + 2' />
	  </xsl:call-template>
	</xsl:when>
	<xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/in-out"'>
	  <!-- We have a normal output message to process -->
	  <xsl:call-template name='process-interfaceMessageReferenceComponent'>
	    <xsl:with-param name='interfaceMessageReferenceComponent'
			    select='$interfaceOperationComponent/cm:interfaceMessageReferences/cm:interfaceMessageReferenceComponent[cm:direction="out"]' />
	    <xsl:with-param name='endpointComponent' select='$endpointComponent' />
	    <xsl:with-param name='position' select='$start + 2' />
	  </xsl:call-template>
	</xsl:when>
	<xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/in-only"
			or $mep = "http://www.w3.org/2006/01/wsdl/robust-in-only"'>
	  <!-- We have an empty output message to process -->
	  <xsl:call-template name='process-interfaceOperationComponent-EmptyOutput'>
	    <xsl:with-param name='interfaceOperationComponent'
			    select='$interfaceOperationComponent' />
	    <xsl:with-param name='endpointComponent' select='$endpointComponent' />
	    <xsl:with-param name='position' select='$start + 2' />
	  </xsl:call-template>
	</xsl:when>
      </xsl:choose>
    </message>

    <!-- Process the rest of the operations -->

    <xsl:if test='count($interfaceOperationComponents) > 1'>
      <xsl:variable name='current'>
	<xsl:call-template name='count-messages-in-interfaceOperationComponents'>
	  <xsl:with-param name='interfaceOperationComponents'
			  select='$interfaceOperationComponent'/>
	</xsl:call-template>
      </xsl:variable>

      <xsl:call-template name='process-interfaceOperationComponents'>
	<xsl:with-param name='interfaceOperationComponents'
			select='$interfaceOperationComponents[position()>1]'/>
	<xsl:with-param name='endpointComponent' select='$endpointComponent' />
	<xsl:with-param name='start' select='$start + $current' />
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name='process-interfaceMessageReferenceComponent'>
    <xsl:param name='interfaceMessageReferenceComponent' />
    <xsl:param name='endpointComponent'/>
    <xsl:param name='position' />

    <xsl:call-template name='compute-message-properties'>
      <xsl:with-param name='interfaceOperationComponent' select='$interfaceMessageReferenceComponent/../..'/>
      <xsl:with-param name='interfaceMessageReferenceComponent' select='$interfaceMessageReferenceComponent'/>
      <xsl:with-param name='endpointComponent'  select='$endpointComponent'/>
      <xsl:with-param name='position' select='$position' />
    </xsl:call-template>
  </xsl:template>

  <xsl:template name='process-interfaceFaultReferenceComponent'>
    <xsl:param name='interfaceFaultReferenceComponent' />
    <xsl:param name='endpointComponent'/>
    <xsl:param name='position' />

    <xsl:call-template name='compute-message-properties'>
      <xsl:with-param name='interfaceOperationComponent' select='$interfaceFaultReferenceComponent/../..'/>
      <xsl:with-param name='interfaceMessageReferenceComponent' select='$interfaceFaultReferenceComponent'/>
      <xsl:with-param name='endpointComponent'  select='$endpointComponent'/>
      <xsl:with-param name='position' select='$position' />
    </xsl:call-template>
  </xsl:template>

  <xsl:template name='process-interfaceOperationComponent-EmptyOutput'>
    <xsl:param name='interfaceOperationComponent' />
    <xsl:param name='endpointComponent'/>
    <xsl:param name='position' />

    <xsl:call-template name='compute-message-properties'>
      <xsl:with-param name='interfaceOperationComponent' select='$interfaceOperationComponent'/>
      <xsl:with-param name='interfaceMessageReferenceComponent' select='foo' />
      <xsl:with-param name='endpointComponent'  select='$endpointComponent'/>
      <xsl:with-param name='position' select='$position' />
    </xsl:call-template>
  </xsl:template>

  <xsl:template name='compute-message-properties'>
    <xsl:param name='interfaceOperationComponent' />
    <!-- this one could be empty (if in-only or robust-in-only without a fault) -->
    <xsl:param name='interfaceMessageReferenceComponent' />
    <xsl:param name='endpointComponent' />
    <xsl:param name='position' />

    <xsl:attribute name='messagePosition'>
      <xsl:value-of select='$position' />
    </xsl:attribute>
    <xsl:attribute name='type'>
      <xsl:choose>
	<xsl:when test='$interfaceMessageReferenceComponent/cm:direction="in"'>request</xsl:when>
	<xsl:when test='$interfaceMessageReferenceComponent/cm:direction="out"'>response</xsl:when>
	<xsl:otherwise>response</xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>

    <xsl:variable name='bindingComponent'
		  select='key("xmlId", $endpointComponent/cm:binding/@ref)' />
    <xsl:variable name='bindingOperationComponent'
		  select='$bindingComponent/cm:bindingOperations/cm:bindingOperationComponent[cm:interfaceOperation[@ref=$interfaceOperationComponent/@xml:id]]' />
    <xsl:variable name='bindingMessageReferenceComponent'
		  select='$bindingOperationComponent/cm:bindingMessageReferences/cm:bindingMessageReferenceComponent[cm:interfaceMessageReference[@ref=$interfaceMessageReferenceComponent/@xml:id]]'/>
    <xsl:variable name='interfaceFaultComponent' 
		  select='key("xmlId", $interfaceMessageReferenceComponent/cm:interfaceFault/@ref)'/>
    <xsl:variable name='bindingFaultComponent'
		  select='$bindingComponent/cm:bindingFaults/cm:bindingFaultComponent[cm:interfaceFault[@ref=$interfaceFaultComponent/@xml:id]]' />
    <xsl:variable name='bindingFaultReferenceComponent'
		  select='$bindingOperationComponent/cm:bindingFaultReferences/cm:bindingFaultReferenceComponent[cm:interfaceFaultReference[@ref=$interfaceFaultComponent/@xml:id]]' />

    <endpoint name='{$endpointComponent/cm:name}' />
    <binding localName='{$bindingComponent/cm:name/cmbase:localName}'
	     namespace='{$bindingComponent/cm:name/cmbase:namespaceName}'
	     type='{$bindingComponent/cm:type}' />
    <interface localName='{$interfaceOperationComponent/../../cm:name/cmbase:localName}'
	       namespace='{$interfaceOperationComponent/../../cm:name/cmbase:namespaceName}'/>
    <operation localName='{$interfaceOperationComponent/cm:name/cmbase:localName}'
	       namespace='{$interfaceOperationComponent/cm:name/cmbase:namespaceName}'
	       mep='{$interfaceOperationComponent/cm:messageExchangePattern}' />
    <xsl:if test='$endpointComponent/cm:address'>
      <address><xsl:value-of select='$endpointComponent/cm:address' /></address>
    </xsl:if>
    <xsl:if test='$bindingComponent/cm:type="http://www.w3.org/2006/01/wsdl/soap"'>
      <xsl:if test='$bindingComponent/cmsoap:soapBindingExtension/cmhttp:httpCookies'>
	<httpCookies>
	  <xsl:value-of select='$bindingComponent/cmsoap:soapBindingExtension/cmhttp:httpCookies'/>
	</httpCookies>
      </xsl:if>
      <xsl:if test='$bindingOperationComponent/cmsoap:soapBindingExtension/cmhttp:httpLocation'>
	<httpLocation>
	  <xsl:value-of select='$bindingOperationComponent/cmsoap:soapBindingExtension/cmhttp:httpLocation'/>
	</httpLocation>
      </xsl:if>
      <xsl:choose>
	<xsl:when test='$bindingMessageReferenceComponent/cmsoap:soapBindingExtension/cmhttp:httpTransferCoding'>
	  <httpTransferEncoding>
	    <xsl:value-of select='$bindingMessageReferenceComponent/cmsoap:soapBindingExtension/cmhttp:httpTransferCoding'/>
	  </httpTransferEncoding>
	</xsl:when>
	<xsl:when test='$bindingOperationComponent/cmsoap:soapBindingExtension/cmhttp:httpTransferCodingDefault'>
	  <httpTransferEncoding>
	    <xsl:value-of select='$bindingOperationComponent/cmsoap:soapBindingExtension/cmhttp:httpTransferCodingDefault'/>
	  </httpTransferEncoding>
	</xsl:when>
	<xsl:when test='$bindingComponent/cmsoap:soapBindingExtension/cmhttp:httpTransferCodingDefault'>
	  <httpTransferEncoding>
	    <xsl:value-of select='$bindingComponent/cmsoap:soapBindingExtension/cmhttp:httpTransferCodingDefault'/>
	  </httpTransferEncoding>
	</xsl:when>
      </xsl:choose>
      <xsl:if test='$endpointComponent/cmsoap:soapEndpointExtension/cmhttp:httpAuthenticationRealm'>
	<httpAuthenticationRealm><xsl:value-of select='$endpointComponent/cmsoap:soapEndpointExtension/cmhttp:httpAuthenticationRealm' /></httpAuthenticationRealm>
      </xsl:if>
      <xsl:if test='$endpointComponent/cmsoap:soapEndpointExtension/cmhttp:httpAuthenticationScheme'>
	<httpAuthenticationScheme><xsl:value-of select='$endpointComponent/cmsoap:soapEndpointExtension/cmhttp:httpAuthenticationScheme' /></httpAuthenticationScheme>
      </xsl:if>
      <soapUnderlyingProtocol>
	<xsl:value-of select='$bindingComponent/cmsoap:soapBindingExtension/cmsoap:soapUnderlyingProtocol' />
      </soapUnderlyingProtocol>
      <soapVersion>
	<xsl:value-of select='$bindingComponent/cmsoap:soapBindingExtension/cmsoap:soapVersion'/>
      </soapVersion>
      <soapMep>
	<xsl:if test='$interfaceOperationComponent/cm:messageExchangePattern="http://www.w3.org/2006/01/wsdl/in-out"
		      or $interfaceOperationComponent/cm:messageExchangePattern="http://www.w3.org/2006/01/wsdl/in-only"
		      or $interfaceOperationComponent/cm:messageExchangePattern="http://www.w3.org/2006/01/wsdl/robust-in-only"'>
	  
	  <xsl:choose>
	    <xsl:when test='$bindingOperationComponent/cmsoap:soapBindingOperationExtension/cmsoap:soapMep'>
	      <xsl:value-of select='$bindingOperationComponent/cmsoap:soapBindingOperationExtension/cmsoap:soapMep'/>
	    </xsl:when>
	    <xsl:when test='$bindingComponent/cmsoap:soapBindingExtension/cmsoap:soapMepDefault'>
	      <xsl:value-of select='$bindingComponent/cmsoap:soapBindingExtension/cmsoap:soapMepDefault'/>
	    </xsl:when>
	    <xsl:when test='$bindingComponent/cmsoap:soapBindingExtension/cmsoap:soapVersion="1.2"'>
	      <xsl:text>http://www.w3.org/2003/05/soap/mep/request-response/</xsl:text>	    
	    </xsl:when>
	  </xsl:choose>
	</xsl:if>
      </soapMep>
      <xsl:if test='$interfaceMessageReferenceComponent'>
	<xsl:if test='$interfaceMessageReferenceComponent/cm:direction="in"
		      and $bindingOperationComponent/cmsoap:soapBindingOperationExtension/cmsoap:soapAction'>
	  <soapAction>
	    <xsl:value-of select='$bindingOperationComponent/cmsoap:soapBindingOperationExtension/cmsoap:soapAction'/>
	  </soapAction>
	</xsl:if>
	<xsl:for-each select='$bindingMessageReferenceComponent/cmsoap:soapBindingMessageReferenceExtension/cmsoap:soapHeaders/cmsoap:soapHeaderBlockComponent'>
	  <xsl:call-template name='generate-soap-header'>
	    <xsl:with-param name='soapHeader' select='.' />
	    <xsl:with-param name='elementDeclarationComponent' select='key("xmlId", cmsoap:elementDeclaration/@ref)'/>
	  </xsl:call-template>
	</xsl:for-each>
	<xsl:for-each select='$bindingMessageReferenceComponent/cmsoap:soapBindingMessageReferenceExtension/cmhttp:httpHeaders/cmhttp:httpHeaderComponent'>
	  <xsl:call-template name='generate-http-header'>
	    <xsl:with-param name='httpHeader' select='.' />
	  </xsl:call-template>
	</xsl:for-each>
	<xsl:for-each select='$bindingMessageReferenceComponent/cmsoap:soapBindingFaultReferenceExtension/cmsoap:soapHeaders/cmsoap:soapHeaderBlockComponent'>
	  <xsl:call-template name='generate-soap-header'>
	    <xsl:with-param name='soapHeader' select='.' />
	    <xsl:with-param name='elementDeclarationComponent' select='key("xmlId", cmsoap:elementDeclaration/@ref)'/>
	  </xsl:call-template>
	</xsl:for-each>
	<xsl:for-each select='$bindingMessageReferenceComponent/cmsoap:soapBindingMessageReferenceExtension/cmsoap:soapModules/cmsoap:soapModuleComponent'>
	  <soapModule required='{./cmsoap:required}'
		      ref ='{./cmsoap:ref}' />
	</xsl:for-each>
	<xsl:for-each select='$bindingOperationComponent/cmsoap:soapBindingOperationExtension/cmsoap:soapModules/cmsoap:soapModuleComponent'>
	  <soapModule required='{./cmsoap:required}'
		      ref='{./cmsoap:ref}' />
	</xsl:for-each>
	<xsl:for-each select='$bindingComponent/cmsoap:soapBindingOperationExtension/cmsoap:soapModules/cmsoap:soapModuleComponent'>
	  <soapModule required='{./cmsoap:required}'
		      ref='{./cmsoap:ref}' />
	</xsl:for-each>
	<xsl:choose>
	  <xsl:when test='local-name($interfaceMessageReferenceComponent)="interfaceFaultReferenceComponent"'>
	    <!-- @@position()=1 isn't correct -->
	    <xsl:for-each select='$bindingFaultReferenceComponent[position()=1]/cmsoap:soapBindingFaultReferenceExtension/cmsoap:soapModules/cmsoap:soapModuleComponent'>
	      <soapModule required='{./cmsoap:required}' ref ='{./cmsoap:ref}' />
	    </xsl:for-each>
	    <xsl:for-each select='$bindingMessageReferenceComponent/cmsoap:soapBindingFaultReferenceExtension/cmsoap:soapModules/cmsoap:soapModuleComponent'>
	      <soapModule required='{./cmsoap:required}' ref ='{./cmsoap:ref}' />
	    </xsl:for-each>
	    <xsl:for-each select='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapModules/cmsoap:soapModuleComponent'>
	      <soapModule required='{./cmsoap:required}' ref ='{./cmsoap:ref}' />
	    </xsl:for-each>
	    <xsl:for-each select='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmhttp:httpHeaders/cmhttp:httpHeaderComponent'>
	      <xsl:call-template name='generate-http-header'>
		<xsl:with-param name='httpHeader' select='.' />
	      </xsl:call-template>
	    </xsl:for-each>
	    <fault>
	      <xsl:attribute name='localName'>
		<xsl:value-of select='$interfaceFaultComponent/cm:name/cmbase:localName'/>
	      </xsl:attribute>
	      <xsl:attribute name='namespace'>
		<xsl:value-of select='$interfaceFaultComponent/cm:name/cmbase:namespaceName'/>
	      </xsl:attribute>
	      <xsl:if test='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultCode'>
		<xsl:choose>
		  <xsl:when test='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultCode/cmsoap:code'>
		    <soapFaultCode type='code'
				   localName='{$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultCode/cmsoap:code/cmbase:localName}'
				   namespace='{$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultCode/cmsoap:code/cmbase:namespaceName}' />
		  </xsl:when>
		  <xsl:otherwise>
		    <soapFaultCode type='#any' />
		  </xsl:otherwise>
		</xsl:choose>
	      </xsl:if>
	      <xsl:if test='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultCode'>
		<xsl:choose>
		  <xsl:when test='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultSubcodes/cmsoap:subcodes/cmsoap:code'>
		    <xsl:for-each select='$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultSubcodes/cmsoap:subcodes/cmsoap:code'>
		      <soapFaultSubcode type='code'
					localName='{$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultSubcodes/cmsoap:subcodes/cmsoap:code/cmbase:localName}'
					namespace='{$bindingFaultComponent/cmsoap:soapBindingFaultExtension/cmsoap:soapFaultSubcodes/cmsoap:subcodes/cmsoap:code/cmbase:namespaceName}' />
		    </xsl:for-each>
		  </xsl:when>
		  <xsl:otherwise>
		    <soapFaultSubcode type='#any' />
		  </xsl:otherwise>
		</xsl:choose>
	      </xsl:if>
	      <contentModel>
		<xsl:variable name='elementDeclarationComponent' select='key("xmlId", $interfaceFaultComponent/cm:elementDeclaration/@ref)'/>
		<xsl:attribute name='localName'>
		  <xsl:value-of select='$elementDeclarationComponent/cm:name/cmbase:localName'/>
		</xsl:attribute>
		<xsl:attribute name='namespace'>
		  <xsl:value-of select='$elementDeclarationComponent/cm:name/cmbase:namespaceName'/>
		</xsl:attribute>
	      </contentModel>
	    </fault>	  
	  </xsl:when>
	  <xsl:otherwise>
	    <xsl:variable name='msgCModel' select='$interfaceMessageReferenceComponent/cm:messageContentModel'/>	      
	    <messageContentModel type='{$msgCModel}'>
	      <xsl:if test='$msgCModel="#element"'>
		<xsl:variable name='elementDeclarationComponent' select='key("xmlId", $interfaceMessageReferenceComponent/cm:elementDeclaration/@ref)'/>
		<xsl:attribute name='localName'>
		  <xsl:value-of select='$elementDeclarationComponent/cm:name/cmbase:localName'/>
		</xsl:attribute>
		<xsl:attribute name='namespace'>
		  <xsl:value-of select='$elementDeclarationComponent/cm:name/cmbase:namespaceName'/>
		</xsl:attribute>
	      </xsl:if>
	    </messageContentModel>	  
	  </xsl:otherwise>
	</xsl:choose>
      </xsl:if>
    </xsl:if>
  </xsl:template>

  <xsl:template name='generate-soap-header'>
    <xsl:param name='soapHeader'/>
    <xsl:param name='elementDeclarationComponent'/>
    
    <soapHeader mustUnderstand='{$soapHeader/cmsoap:mustUnderstand}' required='{$soapHeader/cmsoap:required}'>
      <xsl:attribute name='localName'>
	<xsl:value-of select='$elementDeclarationComponent/cm:name/cmbase:localName'/>
      </xsl:attribute>
      <xsl:attribute name='namespace'>
	<xsl:value-of select='$elementDeclarationComponent/cm:name/cmbase:namespaceName'/>
      </xsl:attribute>
    </soapHeader>
  </xsl:template>
  
  <xsl:template name='generate-http-header'>
    <xsl:param name='httpHeader'/>
    <xsl:param name='elementDeclarationComponent'/>
    
    <httpHeader name='{$httpHeader/cmhttp:name}'
		required='{$httpHeader/cmhttp:required}'
		type='{$httpHeader/cmhttp:typeDefinition/@ref}'/>
  </xsl:template>
  
  <!-- Returns the number of messages from a given list of interface[@ref] -->
  <xsl:template name='count-messages-in-interfaceReferences'>
    <!-- list of interface[@ref] -->
    <xsl:param name='interfaceReferences' />
    
    <xsl:choose>
      <xsl:when test='count($interfaceReferences) = 0'>
	<xsl:text>0</xsl:text>
      </xsl:when>
      <xsl:otherwise>
	<xsl:variable name='interfaceComponent'
		      select='key("xmlId", $interfaceReferences[position()=1]/@ref)' />

	<xsl:variable name='extended'>
	  <xsl:call-template name='count-messages-in-interfaceReferences'>
	    <xsl:with-param name='interfaceReferences' select='$interfaceComponent/cm:extendedInterfaces/cm:interface'/>
	  </xsl:call-template>
	</xsl:variable>

	<xsl:variable name='current'>
	  <xsl:call-template name='count-messages-in-interfaceOperationComponents'>
	    <xsl:with-param name='interfaceOperationComponents'
			    select='$interfaceComponent/cm:interfaceOperations/cm:interfaceOperationComponent'/>
	  </xsl:call-template>
	</xsl:variable>
	<xsl:variable name='rest'>
	  <xsl:call-template name='count-messages-in-interfaceReferences'>
	    <xsl:with-param name='interfaceReferences' select='$interfaceReferences[position()>1]'/>
	  </xsl:call-template>
	</xsl:variable>
	<xsl:value-of select='$extended + $current + $rest'/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name='count-messages-in-interfaceOperationComponents'>
    <xsl:param name='interfaceOperationComponents' />
    <xsl:choose>
      <xsl:when test='count($interfaceOperationComponents) = 0'>
	<xsl:text>0</xsl:text>
      </xsl:when>
      <xsl:otherwise>
	<xsl:variable name='rest'>
	  <xsl:call-template name='count-messages-in-interfaceOperationComponents'>
	    <xsl:with-param name='interfaceOperationComponents' select='$interfaceOperationComponents[position()>1]'/>
	  </xsl:call-template>
	</xsl:variable>
	<xsl:value-of select='2 + $rest'/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

Index: generate-xpath-assertions.xslt
===================================================================
RCS file: /sources/public/2002/ws/desc/test-suite/results-messages/generate-xpath-assertions.xslt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** generate-xpath-assertions.xslt	16 Nov 2006 23:40:25 -0000	1.2
--- generate-xpath-assertions.xslt	18 Nov 2006 10:22:44 -0000	1.3
***************
*** 8,531 ****
  -->
  <xsl:stylesheet version="1.0"
! 		xmlns="http://www.w3.org/1999/xhtml"
  		xmlns:l="http://www.w3.org/2002/ws/desc/logs/"
- 		xmlns:lsoap="http://www.w3.org/2002/ws/desc/logs/eval/soap"
  		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
! 		xmlns:cm='http://www.w3.org/2002/ws/desc/wsdl/component'
! 		xmlns:cmextensions='http://www.w3.org/2002/ws/desc/wsdl/component-extensions'
! 		xmlns:cmbase='http://www.w3.org/2002/ws/desc/wsdl/component-base'
! 		xmlns:cmhttp='http://www.w3.org/2002/ws/desc/wsdl/component-http'
! 		xmlns:cmrpc='http://www.w3.org/2002/ws/desc/wsdl/component-rpc'
! 		xmlns:cmsoap='http://www.w3.org/2002/ws/desc/wsdl/component-soap'
  		xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'
! 		xmlns:soap11='http://schemas.xmlsoap.org/soap/envelope/'
! 		exclude-result-prefixes='cmsoap cmrpc cmhttp cmbase cmextensions cm lsoap'>
!   <xsl:output method="xml" indent="yes" />
! 
!   <xsl:include href='generate-xpath-assertions-soap.xslt'/>
  
!   <xsl:key name='xmlId' match='*' use='@xml:id'/>
  
    <xsl:template match='/'>
!     <xsl:comment>
!  This is a style sheet, generated by generate-xpath-assertions.xslt.
!  ******** DO NOT EDIT *********
! </xsl:comment>
!     <xsl:element name='xsl:stylesheet'>
!       <xsl:attribute name='version' namespace=''>1.0</xsl:attribute>
!       <xsl:element name='xsl:output'>
! 	<xsl:attribute name='method' namespace=''>xml</xsl:attribute>
! 	<xsl:attribute name='indent' namespace=''>yes</xsl:attribute>	
!       </xsl:element>
!       <xsl:element name='xsl:template'>
! 	<xsl:attribute name='match' namespace=''>/</xsl:attribute>
! 	<html>
! 	  <head>
! 	    <title>Results</title>
! 	    <link rel="stylesheet" type="text/css" href=
! 		  "http://www.w3.org/StyleSheets/TR/base.css" />
! 	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
! 	  </head>
! 	  <body>
! 	    <h1>Message exchange results</h1>
! 	    
! 	    <div>
! 	      <xsl:call-template name='process-endpointComponents'>
! 		<xsl:with-param name='endpointComponents' select='/cm:descriptionComponent/cm:services/cm:serviceComponent/cm:endpoints/cm:endpointComponent'/>
! 		<xsl:with-param name='start'>0</xsl:with-param>
! 	      </xsl:call-template>
! 	    </div>
! 	  </body>
! 	</html>
!       </xsl:element>
!     </xsl:element>
!   </xsl:template>
! 
!   <!-- Process a list of endpoint components -->
!   <xsl:template name='process-endpointComponents'>
!     <xsl:param name='endpointComponents'/>
!     <!-- how many operations processed before this endpoint component list? -->
!     <xsl:param name='start'/>
! 
! 
!     <xsl:if test='count($endpointComponents) != 0'>
! 
!       <!-- process the first element of the list -->
!       <xsl:call-template name='process-endpointComponent'>
! 	<xsl:with-param name='endpointComponent' select='$endpointComponents[position()=1]'/>
! 	<xsl:with-param name='start' select='$start'/>
!       </xsl:call-template>
! 
!       <!-- count how many operations are attached to the endpoint -->
!       <xsl:variable name='current'>
! 	<xsl:call-template name='count-messages-in-interfaceReferences'>
! 	  <xsl:with-param name='interfaceReferences'
! 			  select='$endpointComponents[position()=1]/ancestor::cm:serviceComponent/cm:interface'/>
! 	</xsl:call-template>
!       </xsl:variable>
! 
!       <!-- process the remainder of the list -->
!       <xsl:call-template name='process-endpointComponents'>
! 	<xsl:with-param name='endpointComponents' select='$endpointComponents[position()>1]'/>
! 	<xsl:with-param name='start' select='$start + $current'/>
!       </xsl:call-template>
!     </xsl:if>
!   </xsl:template>
! 
!   <xsl:template name='process-endpointComponent'>
!     <xsl:param name='endpointComponent' />
!     <xsl:param name='start' />
! 
!     <xsl:variable name='bindingComponent'
! 		  select='key("xmlId", $endpointComponent/cm:binding/@ref)' />
! 
!     <h2><xsl:text>EndpointComponent </xsl:text>
!     <xsl:value-of select='$endpointComponent/cm:name' /><br />
!     <xsl:text>BindingComponent </xsl:text>
!     <xsl:value-of
! 	select='$bindingComponent/cm:name/cmbase:namespaceName'/>{<xsl:value-of
! 	select='$bindingComponent/cm:name/cmbase:localName'/>}</h2>
! 
! 
!     <xsl:call-template name='process-interfaceReferences'>
!       <xsl:with-param name='interfaceReferences'
! 		      select='$endpointComponent/ancestor::cm:serviceComponent/cm:interface'/>
!       <xsl:with-param name='endpointComponent'
! 		      select='$endpointComponent'/>
!       <xsl:with-param name='start' select='$start'/>
!     </xsl:call-template>
!     
!   </xsl:template>
! 
!   <!-- Process each interface operation component for a given list of interface[@ref] -->
!   <xsl:template name='process-interfaceReferences'>
!     <!-- list of interface[@ref] -->
!     <xsl:param name='interfaceReferences' />
!     <xsl:param name='endpointComponent' />
!     <xsl:param name='start' />
!     
!     <xsl:choose>
!       <xsl:when test='count($interfaceReferences) = 0'>
!       </xsl:when>
!       <xsl:otherwise>
! 	<xsl:variable name='interfaceComponent'
! 		      select='key("xmlId", $interfaceReferences[position()=1]/@ref)' />
! 
! 	<xsl:variable name='extended'>
! 	  <xsl:call-template name='count-messages-in-interfaceReferences'>
! 	    <xsl:with-param name='interfaceReferences' select='$interfaceComponent/cm:extendedInterfaces/cm:interface'/>
! 	  </xsl:call-template>
! 	</xsl:variable>
! 
! 	<xsl:variable name='current'>
! 	  <xsl:call-template name='count-messages-in-interfaceOperationComponents'>
! 	    <xsl:with-param name='interfaceOperationComponents'
! 			    select='$interfaceComponent/cm:interfaceOperations/cm:interfaceOperationComponent'/>
! 	  </xsl:call-template>
! 	</xsl:variable>
! 
! 	<xsl:call-template name='process-interfaceReferences'>
! 	  <xsl:with-param name='interfaceReferences' select='$interfaceComponent/cm:extendedInterfaces/cm:interface'/>
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	  <xsl:with-param name='start' select='$start' />
! 	</xsl:call-template>
! 	
! 	<h3><xsl:text>Interface </xsl:text> <xsl:value-of
! 	select='$interfaceComponent/cm:name/cmbase:namespaceName'/>{<xsl:value-of
! 	select='$interfaceComponent/cm:name/cmbase:localName'/>}</h3>
! 
! 	<xsl:call-template name='process-interfaceOperationComponents'>
! 	  <xsl:with-param name='interfaceOperationComponents'
! 			  select='$interfaceComponent/cm:interfaceOperations/cm:interfaceOperationComponent'/>
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	  <xsl:with-param name='start' select='$start + $extended' />
! 	</xsl:call-template>
! 
! 	<xsl:call-template name='process-interfaceReferences'>
! 	  <xsl:with-param name='interfaceReferences' select='$interfaceReferences[position()>1]'/>
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	  <xsl:with-param name='start' select='$start + $extended + $current' />
! 	</xsl:call-template>
! 
!       </xsl:otherwise>
!     </xsl:choose>
!   </xsl:template>
! 
!   <xsl:template name='process-interfaceOperationComponents'>
!     <xsl:param name='interfaceOperationComponents' />
!     <xsl:param name='endpointComponent' />
!     <xsl:param name='start' />
! 
!     <xsl:variable name='interfaceOperationComponent'
! 		  select='$interfaceOperationComponents[position()=1]'/>
!     <xsl:variable name='mep' select='$interfaceOperationComponent/cm:messageExchangePattern'/>
! 
!     <xsl:variable name='prettyMep'>
!       <xsl:choose>
! 	<xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/in-out"'>
! 	  <xsl:text>in-out</xsl:text>
! 	</xsl:when>
! 	<xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/in-only"'>
! 	  <xsl:text>in-only</xsl:text>
! 	</xsl:when>
! 	<xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/robust-in-only"'>
! 	  <xsl:text>robust-in-only</xsl:text>
! 	</xsl:when>
!       </xsl:choose>
!     </xsl:variable>
! 
!     <h4><xsl:text>[</xsl:text><code>o<xsl:value-of select='$start + 1' /></code><xsl:text>] Operation </xsl:text>
!     <xsl:value-of select='$prettyMep'/>
!     <xsl:text> </xsl:text>
!     <xsl:value-of select='$interfaceOperationComponent/cm:name/cmbase:namespaceName'/>
!     <xsl:text>{</xsl:text>
!     <xsl:value-of select='$interfaceOperationComponent/cm:name/cmbase:localName'/>
!     <xsl:text>}</xsl:text></h4>
! 
!     <dl>
! 
!     <!-- Process the input message -->
!     <xsl:call-template name='process-interfaceMessageReferenceComponent'>
!       <xsl:with-param name='interfaceMessageReferenceComponent'
! 		      select='$interfaceOperationComponent/cm:interfaceMessageReferences/cm:interfaceMessageReferenceComponent[cm:direction="in"]' />
!       <xsl:with-param name='endpointComponent' select='$endpointComponent' />
!       <xsl:with-param name='position' select='$start + 1' />
!     </xsl:call-template>
! 
!     <!-- Process the output or fault message -->    
!     <xsl:choose>
!       <xsl:when test='contains($interfaceOperationComponent/cm:name/cmbase:localName, "Fault")'>
! 	<!-- We have a fault message to process -->
! 	<xsl:call-template name='process-interfaceFaultReferenceComponent'>
! 	  <xsl:with-param name='interfaceFaultReferenceComponent'
! 			  select='$interfaceOperationComponent/cm:interfaceFaultReferences/cm:interfaceFaultReferenceComponent[cm:direction="out"]' />
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	  <xsl:with-param name='position' select='$start + 2' />
! 	</xsl:call-template>
!       </xsl:when>
!       <xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/in-out"'>
! 	<!-- We have a normal output message to process -->
! 	<xsl:call-template name='process-interfaceMessageReferenceComponent'>
! 	  <xsl:with-param name='interfaceMessageReferenceComponent'
! 			  select='$interfaceOperationComponent/cm:interfaceMessageReferences/cm:interfaceMessageReferenceComponent[cm:direction="out"]' />
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	  <xsl:with-param name='position' select='$start + 2' />
! 	</xsl:call-template>
!       </xsl:when>
!       <xsl:when test='$mep = "http://www.w3.org/2006/01/wsdl/in-only"
! 		      or $mep = "http://www.w3.org/2006/01/wsdl/robust-in-only"'>
! 	<!-- We have an empty output message to process -->
! 	<xsl:call-template name='process-interfaceOperationComponent-EmptyOutput'>
! 	  <xsl:with-param name='interfaceOperationComponent'
! 			  select='$interfaceOperationComponent' />
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	  <xsl:with-param name='position' select='$start + 2' />
! 	</xsl:call-template>
!       </xsl:when>
!     </xsl:choose>
! 
!     </dl>
! 
!     <!-- Process the rest of the operations -->
! 
!     <xsl:if test='count($interfaceOperationComponents) > 1'>
!       <xsl:variable name='current'>
! 	<xsl:call-template name='count-messages-in-interfaceOperationComponents'>
! 	  <xsl:with-param name='interfaceOperationComponents'
! 			  select='$interfaceOperationComponent'/>
! 	</xsl:call-template>
!       </xsl:variable>
! 
!       <xsl:call-template name='process-interfaceOperationComponents'>
! 	<xsl:with-param name='interfaceOperationComponents'
! 			select='$interfaceOperationComponents[position()>1]'/>
! 	<xsl:with-param name='endpointComponent' select='$endpointComponent' />
! 	<xsl:with-param name='start' select='$start + $current' />
!       </xsl:call-template>
!     </xsl:if>
!   </xsl:template>
! 
!   <xsl:template name='process-interfaceMessageReferenceComponent'>
!     <xsl:param name='interfaceMessageReferenceComponent' />
!     <xsl:param name='endpointComponent'/>
!     <xsl:param name='position' />
! 
!     <xsl:variable name='direction' select='$interfaceMessageReferenceComponent/cm:direction'/>
! 
!     <xsl:variable name='logMessage'>
!       <xsl:text>/l:log/l:message[@number='</xsl:text>
!       <xsl:value-of select='$position'/>
!       <xsl:text>']</xsl:text>
!     </xsl:variable>
! 
! 
!     <dt>[m<xsl:value-of select='substring($direction, 1, 1)'/><xsl:value-of select='$position' />] Message <code><xsl:value-of select='$direction'/></code>
!     <xsl:call-template name='printMessageInformation'>
!       <xsl:with-param name='logMessage' select='$logMessage' />
!     </xsl:call-template>
!     </dt>
! 
!     <dd class='message'>
! 
!       <xsl:choose>
! 	<xsl:when test='$direction="in"'>
! 	  <xsl:call-template name='generate-assertion'>
! 	    <xsl:with-param name='xpath'>
! 	      <xsl:value-of select='$logMessage'/><xsl:text>/@type='request'</xsl:text>
! 	    </xsl:with-param>
! 	    <xsl:with-param name='description'>The message exchange MUST include a request message</xsl:with-param>
! 	  </xsl:call-template>
! 	</xsl:when>
! 	<xsl:when test='$direction="out"'>
! 	  <xsl:call-template name='generate-assertion'>
! 	    <xsl:with-param name='xpath'>
! 	      <xsl:value-of select='$logMessage'/><xsl:text>/@type='response'</xsl:text>
! 	    </xsl:with-param>
! 	    <xsl:with-param name='description'>The message exchange MUST include a response message</xsl:with-param>
! 	  </xsl:call-template>
! 	</xsl:when>
!       </xsl:choose>
! 
!       <xsl:variable name='bindingComponent'
! 		    select='key("xmlId", $endpointComponent/cm:binding/@ref)'/>
! 
!       <xsl:if test='$bindingComponent/cm:type="http://www.w3.org/2006/01/wsdl/soap"'>
! 	<xsl:call-template name='lsoap:checkSoap'>
! 	  <xsl:with-param name='interfaceMessageReferenceComponent' select='$interfaceMessageReferenceComponent'/>
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent'/>
! 	  <xsl:with-param name='bindingComponent' select='$bindingComponent'/>
! 	  <xsl:with-param name='logMessage' select='$logMessage'/>
! 	</xsl:call-template>
!       </xsl:if>
!     </dd>
    </xsl:template>
  
-   <xsl:template name='process-interfaceFaultReferenceComponent'>
-     <xsl:param name='interfaceFaultReferenceComponent' />
-     <xsl:param name='endpointComponent'/>
-     <xsl:param name='position' />
- 
-     <xsl:variable name='direction' select='$interfaceFaultReferenceComponent/cm:direction'/>
- 
-     <xsl:variable name='logMessage'>
-       <xsl:text>/l:log/l:message[@number='</xsl:text>
-       <xsl:value-of select='$position'/>
-       <xsl:text>']</xsl:text>
-     </xsl:variable>
- 
-     <dt>[fo<xsl:value-of select='$position' />] Fault <code><xsl:value-of select='$direction'/></code>
-     <xsl:call-template name='printMessageInformation'>
-       <xsl:with-param name='logMessage' select='$logMessage' />
-     </xsl:call-template>
-     </dt>
-     <dd class='message'>
- 
-       <xsl:call-template name='generate-assertion'>
- 	<xsl:with-param name='xpath'>
- 	  <xsl:value-of select='$logMessage'/><xsl:text>/@type='response'</xsl:text>
- 	</xsl:with-param>
- 	<xsl:with-param name='description'>The message exchange MUST include a fault response message</xsl:with-param>
-       </xsl:call-template>
  
!       <xsl:variable name='bindingComponent'
! 		    select='key("xmlId", $endpointComponent/cm:binding/@ref)'/>
  
!       <xsl:if test='$bindingComponent/cm:type="http://www.w3.org/2006/01/wsdl/soap"'>
! 	<xsl:call-template name='lsoap:checkSoap'>
! 	  <xsl:with-param name='interfaceMessageReferenceComponent' select='$interfaceFaultReferenceComponent'/>
! 	  <xsl:with-param name='endpointComponent' select='$endpointComponent'/>
! 	  <xsl:with-param name='bindingComponent' select='$bindingComponent'/>
! 	  <xsl:with-param name='logMessage' select='$logMessage'/>
! 	</xsl:call-template>
        </xsl:if>
!     </dd>
!   </xsl:template>
! 
!   <xsl:template name='process-interfaceOperationComponent-EmptyOutput'>
!     <xsl:param name='interfaceOperationComponent' />
!     <xsl:param name='endpointComponent'/>
!     <xsl:param name='position' />
! 
!     <xsl:variable name='logMessage'>
!       <xsl:text>/l:log/l:message[@number='</xsl:text>
!       <xsl:value-of select='$position'/>
!       <xsl:text>']</xsl:text>
!     </xsl:variable>
! 
!     <dt>[mo<xsl:value-of select='$position' />] Message <code>out</code>
!     <xsl:call-template name='printMessageInformation'>
!       <xsl:with-param name='logMessage' select='$logMessage' />
!     </xsl:call-template>
!     </dt>
!     <dd class='message'>
! 
!       <xsl:call-template name='generate-assertion'>
! 	<xsl:with-param name='xpath'>
! 	  <xsl:value-of select='$logMessage'/><xsl:text>/@type='response'</xsl:text>
! 	</xsl:with-param>
! 	<xsl:with-param name='description'>The message exchange MUST include a response message</xsl:with-param>
!       </xsl:call-template>
! 
!       <xsl:call-template name='generate-assertion'>
! 	<xsl:with-param name='xpath'>
! 	  <xsl:value-of select='$logMessage'/><xsl:text>/l:httpHeaders/l:StatusCode[@value='202']</xsl:text>
! 	</xsl:with-param>
! 	<xsl:with-param name='description'>
! 	  <xsl:text>The message response MUST be 202</xsl:text>
! 	</xsl:with-param>
!       </xsl:call-template>
! 
!     </dd>
!   </xsl:template>
! 
!   <xsl:template name='printMessageInformation'>
!     <xsl:param name='logMessage' />
! 
!     <xsl:element name='xsl:choose'>
!       <xsl:element name='xsl:when'>
! 	<xsl:attribute name='test' namespace=''>
! 	  <xsl:value-of select='$logMessage'/>
! 	  <xsl:text>/@timestamp</xsl:text>
! 	</xsl:attribute>	  
! 	<xsl:text> @ </xsl:text>
! 	<code class='timestamp'><xsl:element name='xsl:value-of'>
! 	  <xsl:attribute name='select' namespace=''>
! 	    <xsl:value-of select='$logMessage'/>
! 	    <xsl:text>/@timestamp</xsl:text>
! 	  </xsl:attribute>
! 	</xsl:element></code>
!       </xsl:element>
!       <xsl:element name='xsl:otherwise'>
! 	<span class='failure'> doesn't exist!</span>
!       </xsl:element>	  
!     </xsl:element>
! 
!     <xsl:element name='if' namespace='http://www.w3.org/1999/XSL/Transform'>
!       <xsl:attribute name='test' namespace=''>
! 	<xsl:value-of select='$logMessage'/>
! 	<xsl:text>/l:senderHostAndPort</xsl:text>
!       </xsl:attribute>	  
!       <xsl:text> [</xsl:text>
!       <code class='from'><xsl:element name='value-of' namespace='http://www.w3.org/1999/XSL/Transform'>
! 	<xsl:attribute name='select' namespace=''>
! 	  <xsl:value-of select='$logMessage'/>
! 	  <xsl:text>/l:senderHostAndPort</xsl:text>
! 	</xsl:attribute>
!       </xsl:element></code>
!     </xsl:element>
!     <xsl:element name='if' namespace='http://www.w3.org/1999/XSL/Transform'>
!       <xsl:attribute name='test' namespace=''>
! 	<xsl:value-of select='$logMessage'/>
! 	<xsl:text>/l:receiverHostAndPort</xsl:text>
!       </xsl:attribute>	  
!       <xsl:text> &#8680; </xsl:text>
!       <code class='to'><xsl:element name='value-of' namespace='http://www.w3.org/1999/XSL/Transform'>
! 	<xsl:attribute name='select' namespace=''>
! 	  <xsl:value-of select='$logMessage'/>
! 	  <xsl:text>/l:receiverHostAndPort</xsl:text>
! 	</xsl:attribute>
!       </xsl:element></code>
!       <xsl:text>]</xsl:text>
!     </xsl:element>
!   </xsl:template>
! 
!   <!-- Returns the number of messages from a given list of interface[@ref] -->
!   <xsl:template name='count-messages-in-interfaceReferences'>
!     <!-- list of interface[@ref] -->
!     <xsl:param name='interfaceReferences' />
!     
!     <xsl:choose>
!       <xsl:when test='count($interfaceReferences) = 0'>
! 	<xsl:text>0</xsl:text>
!       </xsl:when>
!       <xsl:otherwise>
! 	<xsl:variable name='interfaceComponent'
! 		      select='key("xmlId", $interfaceReferences[position()=1]/@ref)' />
! 
! 	<xsl:variable name='extended'>
! 	  <xsl:call-template name='count-messages-in-interfaceReferences'>
! 	    <xsl:with-param name='interfaceReferences' select='$interfaceComponent/cm:extendedInterfaces/cm:interface'/>
! 	  </xsl:call-template>
! 	</xsl:variable>
! 
! 	<xsl:variable name='current'>
! 	  <xsl:call-template name='count-messages-in-interfaceOperationComponents'>
! 	    <xsl:with-param name='interfaceOperationComponents'
! 			    select='$interfaceComponent/cm:interfaceOperations/cm:interfaceOperationComponent'/>
! 	  </xsl:call-template>
! 	</xsl:variable>
! 	<xsl:variable name='rest'>
! 	  <xsl:call-template name='count-messages-in-interfaceReferences'>
! 	    <xsl:with-param name='interfaceReferences' select='$interfaceReferences[position()>1]'/>
! 	  </xsl:call-template>
! 	</xsl:variable>
! 	<xsl:value-of select='$extended + $current + $rest'/>
!       </xsl:otherwise>
!     </xsl:choose>
!   </xsl:template>
! 
!   <xsl:template name='count-messages-in-interfaceOperationComponents'>
!     <xsl:param name='interfaceOperationComponents' />
!     <xsl:choose>
!       <xsl:when test='count($interfaceOperationComponents) = 0'>
! 	<xsl:text>0</xsl:text>
!       </xsl:when>
!       <xsl:otherwise>
! 	<xsl:variable name='rest'>
! 	  <xsl:call-template name='count-messages-in-interfaceOperationComponents'>
! 	    <xsl:with-param name='interfaceOperationComponents' select='$interfaceOperationComponents[position()>1]'/>
! 	  </xsl:call-template>
! 	</xsl:variable>
! 	<xsl:value-of select='2 + $rest'/>
!       </xsl:otherwise>
!     </xsl:choose>
    </xsl:template>
  
!   <xsl:template name='generate-assertion'>
!     <xsl:param name='xpath'/>
!     <xsl:param name='description'>No description available</xsl:param>
! 
!     <xsl:element name='xsl:choose'>
!       <xsl:element name='xsl:when'>
! 	<xsl:attribute name="test" namespace=''>
! 	  <xsl:text>not(</xsl:text>
! 	  <xsl:value-of select='$xpath'/>
! 	  <xsl:text>)</xsl:text>
! 	</xsl:attribute>
! 	<p class='failure'>
! 	  <span class='description' style='color:red; font-weight: bold'><xsl:value-of select='$description'/></span>
! 	  <br />
! 	  <code class='xpath'><xsl:value-of select='$xpath'/></code>
! 	</p>
!       </xsl:element>
!       <xsl:element name='xsl:otherwise'>
! 	<p class='success'>
! 	  <span class='description' style='display: none'><xsl:value-of select='$description'/></span>
! 	  <span select='color: green'><xsl:text>[OK] </xsl:text></span>
! 	  <code class='xpath'><xsl:value-of select='$xpath'/></code>
! 	</p>
!       </xsl:element>
!     </xsl:element>
    </xsl:template>
- 
  </xsl:stylesheet>
--- 8,145 ----
  -->
  <xsl:stylesheet version="1.0"
! 		xmlns="http://www.w3.org/2006/11/desc/assertions"
! 		xmlns:m="http://www.w3.org/2006/11/desc/messages"
  		xmlns:l="http://www.w3.org/2002/ws/desc/logs/"
  		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
! 		xmlns:module="http://www.w3.org/2002/ws/desc/6/10/test-module"
  		xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'
! 		xmlns:soap11='http://schemas.xmlsoap.org/soap/envelope/'>
  
!   <xsl:output method="xml" indent="yes" />
  
    <xsl:template match='/'>
!     <assertionSets>
!       <xsl:apply-templates select='/m:messages/m:message'/>
!     </assertionSets>
    </xsl:template>
  
  
!   <xsl:template match="m:message">
!     <assertionSet messagePosition='{@messagePosition}'>
!       <xsl:for-each select='.'>
! 	<xsl:copy>
! 	  <xsl:apply-templates select='@*|*'/>
! 	</xsl:copy>
!       </xsl:for-each>
  
!       <xsl:variable name='msg'>/l:log/l:message[@number="<xsl:value-of select='@messagePosition'/>"]</xsl:variable>		    
!       <assertion><xsl:value-of select='$msg'/>/@type="<xsl:value-of select='@type' />"</assertion>
!       <xsl:if test='m:soapVersion="1.2"'>
! 	<xsl:if test='@type="request"'>
! 	  <xsl:choose>
! 	    <xsl:when test='m:soapMep="http://www.w3.org/2003/05/soap/mep/soap-response/"'>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:Method/@value='GET'</assertion>
! 	    </xsl:when>
! 	    <xsl:otherwise>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:Method/@value='POST'</assertion>
! 	    </xsl:otherwise>
! 	  </xsl:choose>
! 	</xsl:if>
! 	<xsl:if test='@type="response"'>
! 	  <xsl:choose>
! 	    <xsl:when test='m:fault/m:soapFaultCode[@type="code"
! 			    and @localName="Sender"
! 			    and @namespace="http://www.w3.org/2003/05/soap-envelope"]'>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:StatusCode/@value='400'</assertion>
! 	    </xsl:when>
! 	    <xsl:when test='m:fault/m:soapFaultCode[@type="code"
! 			    and @localName="Receiver"
! 			    and @namespace="http://www.w3.org/2003/05/soap-envelope"]'>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:StatusCode/@value='500'</assertion>
! 	    </xsl:when>
! 	    <xsl:when test='m:fault'>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:StatusCode/@value='500'</assertion>
! 	    </xsl:when>
! 	    <xsl:when test='m:operation/@mep="http://www.w3.org/2006/01/wsdl/in-out"'>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:StatusCode/@value='200'</assertion>
! 	    </xsl:when>
! 	    <xsl:when test='m:operation/@mep="http://www.w3.org/2006/01/wsdl/in-only"
! 			    or m:operation/@mep="http://www.w3.org/2006/01/wsdl/robust-in-only"'>
! 	      <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:StatusCode/@value='202'</assertion>
! 	    </xsl:when>
! 	  </xsl:choose>
! 	</xsl:if>
! 	<xsl:if test='(@type="request"
! 		       and m:soapMep!="http://www.w3.org/2003/05/soap/mep/soap-response/")
! 		      or
!                       (@type="response"
! 		       and m:operation/@mep="http://www.w3.org/2006/01/wsdl/in-out")'>
! 	  <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:Content-Type/@type='application/soap+xml'</assertion>
! 	  <assertion><xsl:value-of select='$msg'/>/l:content/soap12:Envelope</assertion>
! 	</xsl:if>
! 	<xsl:if test='m:soapAction'>
! 	  <assertion><xsl:value-of select='$msg'/>/l:httpHeaders/l:Content-Type[@type='application/soap+xml']/l:action="<xsl:value-of select='m:soapAction'/>"</assertion>
! 	</xsl:if>
! 	<xsl:if test='m:fault'>
! 	  <assertion>count(<xsl:value-of select='$msg'/>/l:content/soap12:Envelope/soap12:Body/*)=1</assertion>
! 	  <assertion><xsl:value-of select='$msg'/>/l:content/soap12:Envelope/soap12:Body/*[local-name()='Fault' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']</assertion>
! 	</xsl:if>
! 	<xsl:if test='m:soapModule/@ref="http://www.w3.org/2002/ws/desc/6/10/test-module"'>
! 	  <assertion><xsl:value-of select='$msg'/>/l:content/soap12:Envelope/soap12:Header/module:module-test</assertion>
! 	</xsl:if>
! 	<xsl:for-each select='m:soapHeader[@required="true"]'>
! 	  <assertion>
! 	    <xsl:value-of select='$msg'/>
! 	    <xsl:text>/l:content/soap12:Envelope/soap12:Header/*[</xsl:text>
! 	    <xsl:if test='@mustUnderstand="true"'>@mustUnderstand="true" and</xsl:if>
! 	    <xsl:text>local-name()="</xsl:text>
! 	  <xsl:value-of select='@localName'/>" and namespace-uri()="<xsl:value-of select='@namespace'/>"]</assertion>
! 	</xsl:for-each>
! 	<xsl:for-each select='m:httpHeader[@required="true"]'>
! 	  <assertion>
! 	    <xsl:value-of select='$msg'/>
! 	    <xsl:text>/l:httpHeaders/l:</xsl:text>
! 	    <xsl:value-of select='@name'/>
! 	  </assertion>
! 	</xsl:for-each>
! 	<xsl:if test='(@type="request"
! 		       and m:soapMep!="http://www.w3.org/2003/05/soap/mep/soap-response/")
! 		      or
!                       (@type="response"
! 		       and count(m:fault)=0
! 		       and m:operation/@mep="http://www.w3.org/2006/01/wsdl/in-out")'>
! 	  <xsl:choose>
! 	    <xsl:when test='m:messageContentModel/@type="#any"'>
! 	      <!-- it's anything, just check the number.
! 		   is it really one or can it be more?
! 	      -->
! 	      <assertion>count(<xsl:value-of select='$msg'/>/l:content/soap12:Envelope/soap12:Body/*)&lt;=1</assertion>
! 	    </xsl:when>
! 	    <xsl:when test='m:messageContentModel/@type="#other"'>
! 	    </xsl:when>
! 	    <xsl:when test='m:messageContentModel/@type="#none"'>
! 	      <assertion>count(<xsl:value-of select='$msg'/>/l:content/soap12:Envelope/soap12:Body/*)=0</assertion>
! 	    </xsl:when>
! 	    <xsl:when test='m:messageContentModel/@type="#element"'>
! 	      <assertion>count(<xsl:value-of select='$msg'/>/l:content/soap12:Envelope/soap12:Body/*)=1</assertion>
! 	      <assertion>
! 		<xsl:value-of select='$msg'/>
! 		<xsl:text>/l:content/soap12:Envelope/soap12:Body/*[local-name()='</xsl:text>
! 		<xsl:value-of select='m:messageContentModel/@localName'/>
! 		<xsl:text>' and namespace-uri()='</xsl:text>
! 		<xsl:value-of select='m:messageContentModel/@namespace'/>
! 		<xsl:text>']</xsl:text>
! 	      </assertion>	  
! 	    </xsl:when>
! 	  </xsl:choose>
! 	</xsl:if>
        </xsl:if>
!     </assertionSet>
    </xsl:template>
  
!   <xsl:template match="@*|*|text()">
!     <xsl:copy>
!       <xsl:apply-templates select='@*|*|text()'/>
!     </xsl:copy>
    </xsl:template>
  </xsl:stylesheet>

Index: build.xml
===================================================================
RCS file: /sources/public/2002/ws/desc/test-suite/results-messages/build.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** build.xml	17 Nov 2006 10:19:09 -0000	1.3
--- build.xml	18 Nov 2006 10:22:44 -0000	1.4
***************
*** 2,6 ****
  <project name="wsdl-interchange-format" default="main" basedir=".">
  
! 	<target name="main" depends="generate-message-log-result"/>
  
  	<target name="clean" depends="clean-message-eval, clean-message-log-result"/>
--- 2,6 ----
  <project name="wsdl-interchange-format" default="main" basedir=".">
  
!   <target name="main" depends="generate-message-log-result"/>
  
  	<target name="clean" depends="clean-message-eval, clean-message-log-result"/>
***************
*** 17,76 ****
  -->
  	<target name='generate-message-log-result' description='Evaluate the message logs'
! 		depends='convert-message-log, generate-message-eval'>
! 	  <xslt style="MessageTest-1G/SOAPservice-message-eval.xsl" extension="-results.html"
  		basedir="MessageTest-1G" destdir="MessageTest-1G" includes="*.descmsg">
! 	    <factory name="org.apache.xalan.processor.TransformerFactoryImpl">
! 	      <attribute name="http://xml.apache.org/xalan/features/optimize" value="false"/>
! 	    </factory>
  	  </xslt>
! 	  <xslt style="MessageTest-2G/HTTPservice-message-eval.xsl" extension="-results.html"
  		basedir="MessageTest-2G" destdir="MessageTest-2G" includes="*.descmsg" />
! 	  <xslt style="MessageTest-3G/HTTPservice-message-eval.xsl" extension="-results.html"
  		basedir="MessageTest-3G" destdir="MessageTest-3G" includes="*.descmsg" />
  	</target>
  	
- 
  	<target name='convert-message-log' description='Convert WS-I Log messages into test suite format'>
! 		<xslt style='ws-i.xsl' basedir='.' destdir='.'>
! 			<mapper type="glob" from="*.wsimsg" to="*.descmsg" />
! 		</xslt>
  	</target>
  
  	<target name="clean-message-log-result">
! 		<delete>
! 		  <fileset dir="." includes="*/*-results.html"/>
! 		  <fileset dir="." includes="*/*.descmsg"/>
! 		</delete>
  	</target>
  
! 	<target name='generate-message-eval' description='Convert WSDL Components into XPath assertions'
! 		depends='run-wsdl-xslt'>
  	  <xslt style='generate-xpath-assertions.xslt' basedir='.' destdir='.'>
! 	    <mapper type="glob" from="*.wsdlcm" to="*-message-eval.xsl"/>
  	  </xslt>
  	</target>
  
- 	<!-- wsdl-xslt-specific tasks -->
- 	
  	<target name="run-wsdl-xslt" description="Run wsdl-xslt to generate a complete set of wsdlcm files.">
  	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		basedir="../documents/good/MessageTest-1G" destdir="MessageTest-1G" >
! 	    <mapper type="glob" from="*.wsdl" to="*.wsdlcm"/>
! 	  </xslt>
  	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		basedir="../documents/good/MessageTest-2G" destdir="MessageTest-2G" >
! 	    <mapper type="glob" from="*.wsdl" to="*.wsdlcm"/>
! 	  </xslt>
  	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		basedir="../documents/good/MessageTest-3G" destdir="MessageTest-3G" >
! 	    <mapper type="glob" from="*.wsdl" to="*.wsdlcm"/>
! 	  </xslt>
  	</target>
  
  	<target name="clean-message-eval">
! 		<delete>
! 		  <fileset dir="." includes="*/*-message-eval.xsl"/>
! 		  <fileset dir="." includes="*/*.wsdlcm"/>
! 		</delete>
  	</target>
  
--- 17,88 ----
  -->
  	<target name='generate-message-log-result' description='Evaluate the message logs'
! 		depends='convert-message-log, evaluate-html-log-xsl'>
! 	  <tstamp />
! 	  <xslt style="MessageTest-1G/description-generate-report-html.xsl" extension="-results.html"
  		basedir="MessageTest-1G" destdir="MessageTest-1G" includes="*.descmsg">
! 	    <param name="DSTAMP" expression="${DSTAMP}"/>
! 	    <param name="TSTAMP" expression="${TSTAMP}"/>
! 	    <param name="TODAY" expression="${TODAY}"/>
  	  </xslt>
! 	  <xslt style="MessageTest-2G/description-generate-report-html.xsl" extension="-results.html"
  		basedir="MessageTest-2G" destdir="MessageTest-2G" includes="*.descmsg" />
! 	  <xslt style="MessageTest-3G/description-generate-report-html.xsl" extension="-results.html"
  		basedir="MessageTest-3G" destdir="MessageTest-3G" includes="*.descmsg" />
+ 	  <xslt style="MessageTest-4G/description-generate-report-html.xsl" extension="-results.html"
+ 		basedir="MessageTest-4G" destdir="MessageTest-4G" includes="*.descmsg" />
  	</target>
  	
  	<target name='convert-message-log' description='Convert WS-I Log messages into test suite format'>
! 	  <xslt style='ws-i.xsl' basedir='.' destdir='.'>
! 	    <mapper type="glob" from="*.wsimsg" to="*.descmsg" />
! 	  </xslt>
  	</target>
  
  	<target name="clean-message-log-result">
! 	  <delete>
! 	    <fileset dir="." includes="*/*-results.html"/>
! 	    <fileset dir="." includes="*/*.descmsg"/>
! 	  </delete>
  	</target>
  
! 	<target name='evaluate-html-log-xsl' description='Generate XSLTs to evaluate the message logs with HTML output'
! 		depends='generate-xpath-assertions, generate-message-properties'>
! 	  <xslt style='evaluate-html-log-xsl.xslt' basedir='.' destdir='.'>
! 	    <mapper type="glob" from="*-xpath-assertions.xml" to="*-generate-report-html.xsl"/>
! 	  </xslt>
! 	</target>
! 	
! 	<target name='generate-xpath-assertions' description='Convert WSDL message properties into XPath expressions'
! 		depends='generate-message-properties'>
  	  <xslt style='generate-xpath-assertions.xslt' basedir='.' destdir='.'>
! 	    <mapper type="glob" from="*-message-properties.xml" to="*-xpath-assertions.xml"/>
! 	  </xslt>
! 	</target>
! 
! 	<target name='generate-message-properties' description='Convert WSDL Components into WSDL message properties'
! 		depends='run-wsdl-xslt'>
! 	  <xslt style='generate-message-properties.xslt' basedir='.' destdir='.'>
! 	    <mapper type="glob" from="*.wsdlcm" to="*-message-properties.xml"/>
  	  </xslt>
  	</target>
  
  	<target name="run-wsdl-xslt" description="Run wsdl-xslt to generate a complete set of wsdlcm files.">
  	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		in="../documents/good/MessageTest-1G/SOAPservice.wsdl" out="MessageTest-1G/description.wsdlcm"/>
  	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		in="../documents/good/MessageTest-2G/HTTPservice.wsdl" out="MessageTest-2G/description.wsdlcm"/>
  	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		in="../documents/good/MessageTest-3G/HTTPservice.wsdl" out="MessageTest-3G/description.wsdlcm"/>
! 	  <xslt style="../results/wsdl-xslt/wsdl-component-model.xslt"
! 		in="../documents/good/MessageTest-4G/SOAPservice.wsdl" out="MessageTest-4G/description.wsdlcm"/>
  	</target>
  
  	<target name="clean-message-eval">
! 	  <delete>
! 	    <fileset dir="." includes="*/*-generate-report-html.xsl"/>
! 	    <fileset dir="." includes="*/*-xpath-assertions.xml"/>
! 	    <fileset dir="." includes="*/*-message-properties.xml"/>
! 	    <fileset dir="." includes="*/*.wsdlcm"/>
! 	  </delete>
  	</target>
  

--- NEW FILE: evaluate-html-log-xsl.xslt ---
<?xml version="1.0" encoding="utf-8"?>
<!--

    $Header: /sources/public/2002/ws/desc/test-suite/results-messages/evaluate-html-log-xsl.xslt,v 1.1 2006/11/18 10:22:44 plehegar Exp $

    Convert WSDL Component model into XPath expressions

-->
<xsl:stylesheet version="1.0"
		xmlns:a="http://www.w3.org/2006/11/desc/assertions"
		xmlns:m="http://www.w3.org/2006/11/desc/messages"
		xmlns:l="http://www.w3.org/2002/ws/desc/logs/"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:module="http://www.w3.org/2002/ws/desc/6/10/test-module"
		xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'
		xmlns:soap11='http://schemas.xmlsoap.org/soap/envelope/'>

  <xsl:output method="xml" />

  <xsl:template match='/'>
     <xsl:comment>
 This is a style sheet, generated by generate-xpath-assertions.xslt.
 ******** DO NOT EDIT *********
</xsl:comment>
    <xsl:element name='xsl:stylesheet'>
      <xsl:attribute name='version' namespace=''>1.0</xsl:attribute>
      <xsl:attribute name='l:fake' namespace='http://www.w3.org/2002/ws/desc/logs/'>false</xsl:attribute>
      <xsl:element name='xsl:param'>
	<xsl:attribute name='name' namespace=''>DSTAMP</xsl:attribute>
      </xsl:element>
      <xsl:element name='xsl:param'>
	<xsl:attribute name='name' namespace=''>TSTAMP</xsl:attribute>
      </xsl:element>
      <xsl:element name='xsl:param'>
	<xsl:attribute name='name' namespace=''>TODAY</xsl:attribute>
      </xsl:element>
      <xsl:element name='xsl:output'>
	<xsl:attribute name='method' namespace=''>html</xsl:attribute>
      </xsl:element>
      <xsl:element name='xsl:template'>
	<xsl:attribute name='match' namespace=''>/</xsl:attribute>
	<html>
	  <head>
	    <title>Results</title>
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	  </head>
	  <body>
	    <h1>Message exchange results       <xsl:element name='xsl:value-of'>
	    <xsl:attribute name='select' namespace=''>$TODAY</xsl:attribute></xsl:element></h1>
	    
	    <div>
	      <xsl:element name='xsl:if'>
		<xsl:attribute name='test' namespace=''>count(/l:log/l:message)!=<xsl:value-of select='count(/a:assertionSets/a:assertionSet)'/></xsl:attribute>
		<p style='color:red;font-size: 150%;'>Only got
		<xsl:element name='xsl:value-of'>
		<xsl:attribute name='select' namespace=''>count(/l:log/l:message)</xsl:attribute></xsl:element>
		out of <xsl:value-of select='count(/a:assertionSets/a:assertionSet)'/></p>
	      </xsl:element>
	    </div>
	    <div>
	      <xsl:element name='xsl:apply-templates'>
		<xsl:attribute name='select' namespace=''>/l:log/l:message</xsl:attribute>                
	      </xsl:element>
	    </div>
	  </body>
	</html>
      </xsl:element>
      <xsl:apply-templates select='/a:assertionSets/a:assertionSet' />

    </xsl:element>
  </xsl:template>

  <xsl:template match="a:assertionSet">    
    <xsl:element name='xsl:template'>
      <xsl:attribute name='match' namespace=''>l:message[@number="<xsl:value-of select='@messagePosition'/>"]</xsl:attribute>                

          <h3>Message <xsl:value-of select='@messagePosition'/> (<xsl:value-of select='m:message/@type'/>)
	    <xsl:element name='if' namespace='http://www.w3.org/1999/XSL/Transform'>
	      <xsl:attribute name='test' namespace=''>
		<xsl:text>l:senderHostAndPort</xsl:text>
	      </xsl:attribute>	  
	      <xsl:text> [</xsl:text>
	      <code class='from'><xsl:element name='value-of' namespace='http://www.w3.org/1999/XSL/Transform'>
		<xsl:attribute name='select' namespace=''>
		  <xsl:text>l:senderHostAndPort</xsl:text>
		</xsl:attribute>
	      </xsl:element></code>
	    </xsl:element>
	    <xsl:element name='if' namespace='http://www.w3.org/1999/XSL/Transform'>
	      <xsl:attribute name='test' namespace=''>
		<xsl:text>l:receiverHostAndPort</xsl:text>
	      </xsl:attribute>	  
	      <xsl:text> &#8680; </xsl:text>
	      <code class='to'><xsl:element name='value-of' namespace='http://www.w3.org/1999/XSL/Transform'>
		<xsl:attribute name='select' namespace=''>
		  <xsl:text>l:receiverHostAndPort</xsl:text>
		</xsl:attribute>
	      </xsl:element></code>
	    </xsl:element>
	    <xsl:text>]</xsl:text>
	  </h3>
	  <p style='font-size:small'>
	    <xsl:text>EndpointComponent </xsl:text><xsl:value-of select='m:message/m:endpoint/@name' /><br />
	    <xsl:text>BindingComponent </xsl:text><xsl:value-of
	    select='m:message/m:binding/@namespace'/>{<xsl:value-of
	    select='m:message/m:binding/@localName'/>}<br />
	    <xsl:text>Operation </xsl:text><xsl:value-of
	    select='m:message/m:operation/@namespace'/>{<xsl:value-of
	    select='m:message/m:operation/@localName'/>}<br />
	    <xsl:text>WSDL MEP </xsl:text><xsl:value-of
	    select='m:message/m:operation/@mep'/><br />
	    <xsl:if test='m:message/m:soapMep'>
	      <xsl:text>SOAP MEP </xsl:text><xsl:value-of
	      select='m:message/m:soapMep'/><br />
	    </xsl:if>
	  </p>
	  <div>
	    <xsl:for-each select='a:assertion'>	    
	      <xsl:element name='xsl:choose'>
		<xsl:element name='xsl:when'>
		  <xsl:attribute name='test' namespace=''>
		    <xsl:value-of select='.'/>
		  </xsl:attribute>	  
		  <p><xsl:text>[OK] </xsl:text><xsl:value-of select='.'/></p>
		</xsl:element>
		<xsl:element name='xsl:otherwise'>
		  <p><span style='color:red'><xsl:text>[FAILED] </xsl:text></span><xsl:value-of select='text()'/></p>
		</xsl:element>	  
	      </xsl:element>
	    </xsl:for-each>
	  </div>
    </xsl:element>

  </xsl:template>
</xsl:stylesheet>

Received on Saturday, 18 November 2006 10:23:01 UTC