2002/ws/desc/test-suite/results-messages ws-i.xsl,1.1,1.2

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

Modified Files:
	ws-i.xsl 
Log Message:
Added content-type parameters handling
Improved URI parameters handling


Index: ws-i.xsl
===================================================================
RCS file: /sources/public/2002/ws/desc/test-suite/results-messages/ws-i.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** ws-i.xsl	16 Nov 2006 15:10:56 -0000	1.1
--- ws-i.xsl	16 Nov 2006 17:34:51 -0000	1.2
***************
*** 148,164 ****
  	      <xsl:element name='{$name}'>
  		<xsl:variable name='content' select='substring-after($text, ": ")'/>
! 		<xsl:if test='$name="Content-Type"'>
! 		  <xsl:attribute name='type'>
! 		    <xsl:choose>
! 		      <xsl:when test='contains($content, ";")'>
! 			<xsl:value-of select='substring-before($content, ";")'/>
! 		      </xsl:when>
! 		      <xsl:otherwise>
! 			<xsl:value-of select='$content'/>
! 		      </xsl:otherwise>
! 		    </xsl:choose>
! 		  </xsl:attribute>
! 		</xsl:if>
! 		<xsl:value-of select='$content'/>
  	      </xsl:element>
  	    </xsl:when>
--- 148,161 ----
  	      <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>
***************
*** 176,181 ****
  	    <xsl:when test='contains($text, "?")'>
  	      <uri><xsl:value-of select='substring-before($text, "?")'/></uri>
! 	      <xsl:call-template name='replaceURIParams'>
  		<xsl:with-param name='text' select='substring-after($text, "?")'/>
  	      </xsl:call-template>
  	    </xsl:when>
--- 173,179 ----
  	    <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>
***************
*** 196,199 ****
--- 194,198 ----
  	      <xsl:call-template name='replaceURIParams'>
  		<xsl:with-param name='text' select='substring-after($text, "&amp;")'/>
+ 		<xsl:with-param name='sep'>;</xsl:with-param>
  	      </xsl:call-template>
  	    </xsl:when>
***************
*** 207,210 ****
--- 206,248 ----
  	</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='{substring-before($text, "=")}'><xsl:value-of select='substring-after($text, "=")'/></xsl:element>
+ 	    </xsl:when>
+ 	  </xsl:choose>
+ 
+ 	</xsl:template>
+ 
  	<!-- http://xsltsl.sourceforge.net/ -->
  	<xsl:template name="replaceContent">

Received on Thursday, 16 November 2006 17:37:43 UTC