2002/ws/desc/test-suite/results-messages evaluate-xml-log-xsl.xslt,NONE,1.1

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

Added Files:
	evaluate-xml-log-xsl.xslt 
Log Message:
New

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

    $Header: /sources/public/2002/ws/desc/test-suite/results-messages/evaluate-xml-log-xsl.xslt,v 1.1 2006/11/18 15:42:07 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=''>xml</xsl:attribute>
      </xsl:element>
      <xsl:element name='xsl:template'>
	<xsl:attribute name='match' namespace=''>/</xsl:attribute>
	<resultSets>
	  <head>
	    <messageTotal><xsl:element name='xsl:value-of'>
		<xsl:attribute name='select' namespace=''>count(/l:log/l:message)</xsl:attribute></xsl:element></messageTotal>
	    <expectedMessages><xsl:value-of select='count(/a:assertionSets/a:assertionSet)'/></expectedMessages>
	    <expectedTests><xsl:value-of select='count(/a:assertionSets/a:assertionSet/a:assertion)'/></expectedTests>
	    <tstamp><xsl:element name='xsl:value-of'>
		<xsl:attribute name='select' namespace=''>/l:log/l:message/@timestamp</xsl:attribute></xsl:element></tstamp>
	    <generated><xsl:element name='xsl:value-of'>
	    <xsl:attribute name='select' namespace=''>$TODAY</xsl:attribute></xsl:element></generated>
	    <from><xsl:element name='xsl:call-template'>
		<xsl:attribute name='name'>find-agent</xsl:attribute>
		<xsl:element name='xsl:with-param'>
		  <xsl:attribute name='name'>message</xsl:attribute>
		  <xsl:attribute name='select'>/l:log/l:message[@type="request"]</xsl:attribute>
		</xsl:element>
	      </xsl:element></from>
	      <to><xsl:element name='xsl:call-template'>
		<xsl:attribute name='name'>find-agent</xsl:attribute>
		<xsl:element name='xsl:with-param'>
		  <xsl:attribute name='name'>message</xsl:attribute>
		  <xsl:attribute name='select'>/l:log/l:message[@type="response"]</xsl:attribute>
		</xsl:element>
	      </xsl:element></to>
	  </head>	    
	  <xsl:element name='xsl:apply-templates'>
	    <xsl:attribute name='select' namespace=''>/l:log/l:message</xsl:attribute>                
	  </xsl:element>
	</resultSets>
      </xsl:element>
      <xsl:element name='xsl:template'>
	<xsl:attribute name='name'>find-agent</xsl:attribute>
	<xsl:element name='xsl:param'>
	  <xsl:attribute name='name'>message</xsl:attribute>
	</xsl:element>
	
	<xsl:element name='xsl:choose'>
	  <xsl:element name='xsl:when'>
	    <xsl:attribute name='test'>$message/l:httpHeaders/l:Server</xsl:attribute>
	    <xsl:element name='xsl:value-of'>
	      <xsl:attribute name='select'>$message/l:httpHeaders/l:Server</xsl:attribute>
	    </xsl:element>
	  </xsl:element>
	  <xsl:element name='xsl:when'>
	    <xsl:attribute name='test'>$message/l:httpHeaders/l:User-Agent</xsl:attribute>
	    <xsl:element name='xsl:value-of'>
	      <xsl:attribute name='select'>$message/l:httpHeaders/l:User-Agent</xsl:attribute>
	    </xsl:element>
	  </xsl:element>
	  <xsl:element name='xsl:otherwise'>
	    <xsl:text>Unknown</xsl:text>
	  </xsl:element>
	</xsl:element>
      </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>                
      <resultSet number='{@messagePosition}' type='{m:message/@type}'>
	<xsl:element name='xsl:attribute'>
	  <xsl:attribute name='name'>implementation</xsl:attribute>
	  <xsl:element name='xsl:call-template'>
	    <xsl:attribute name='name'>find-agent</xsl:attribute>
	    <xsl:element name='xsl:with-param'>
	      <xsl:attribute name='name'>message</xsl:attribute>
	      <xsl:attribute name='select'>.</xsl:attribute>
	    </xsl:element>
	</xsl:element></xsl:element>
	<xsl:for-each select='a:assertion'>	    
	  <test>
	    <xsl:element name='xsl:attribute'>
	      <xsl:attribute name='name'>result</xsl:attribute>
	      <xsl:element name='xsl:choose'>
		<xsl:element name='xsl:when'>
		  <xsl:attribute name='test' namespace=''>
		    <xsl:value-of select='.'/>
		  </xsl:attribute>	  
		  <xsl:text>passed</xsl:text>
		</xsl:element>
		<xsl:element name='xsl:otherwise'>
		  <xsl:text>failed</xsl:text>
		</xsl:element>	  
	      </xsl:element>
	    </xsl:element>
	    <xsl:value-of select='.'/>
	  </test>
	</xsl:for-each>
      </resultSet>
    </xsl:element>

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

Received on Saturday, 18 November 2006 15:42:26 UTC