Simplification of slice import. NT.
[sfa.git] / wsdl / wsdl2html.xsl
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet 
3 version="1.0"  
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
6 xmlns:fn="http://www.w3.org/2005/02/xpath-functions" 
7 >
8 <xsl:output method="html" />
9
10 <!-- to locate the out message -->
11 <xsl:key name="messages" match="wsdl:message" use="@name"/>
12
13 <xsl:template match="wsdl:definitions">
14 <html>
15 <head> <title> <xsl:value-of select="./@name" /> </title> </head>
16 <body>
17 <table border='1'><tr><th>method</th><th>in</th><th>out</th></tr>
18 <xsl:apply-templates mode="messages" />
19 </table>
20 </body>
21 </html>
22 </xsl:template>
23
24 <xsl:template match="wsdl:message" mode="messages">
25 <xsl:variable name="methodname" select="substring-before(@name,'_in')" />
26 <xsl:variable name="outmessage" select="concat($methodname,'_out')" />
27 <xsl:if test="contains(@name,'_in')">
28 <tr>
29 <td>
30 <xsl:value-of select="$methodname" />
31 </td>
32 <td>
33 <xsl:for-each select="wsdl:part">
34 <xsl:value-of select="@name" />
35 (<xsl:value-of select="@type" />)
36 <xsl:text> </xsl:text>
37 </xsl:for-each>
38 </td>
39 <td> 
40 <xsl:value-of select="key('messages',$outmessage)/wsdl:part/@type" />
41
42 </td>
43 </tr>
44 </xsl:if>
45 </xsl:template>
46
47 </xsl:stylesheet>
48