1 <?xml-stylesheet type="text/xsl" href="#"?>
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:res="http://example.com/test"
7 <xsl:template match="xsl:stylesheet">
10 <style type="text/css">
11 body { background-color:#F0F0F0; font: 9pt Verdana, Arial, "Arial Unicode MS", Helvetica, sans-serif;}
12 input.button { font:8pt Verdana, Arail, "Arial Unicode MS", Helvetica, sans-serif;}
14 div.DDB { position:absolute; top:20pt; left:15pt; visibility:visible; }
15 div.DLC { position:absolute; top:20pt; left:15pt; visibility:hidden; }
16 div.numFound { position:absolute; top:0px; left:0pt; font-weight:bold;}
18 table { background-color:lightgray; font-size:10pt; margin:10pt 0pt 15pt 0pt; width:90%; border-collapse: collapse; spacing:0; padding:0;}
19 td { background-color:#f0f0f0; border: solid lightgray 1px; }
20 td.fulltag { background-color:#f0f0f0;}
21 td.fullind { background-color:#f0f0f0; width:20pt;}
22 td.fullfield{ background-color:#f0f0f0; width:100%;}
24 table.signature { background-color:lightgray; font-size:10pt; margin:0; width:100%; border:none; padding:0;}
25 table.params { background-color:lightgray; font-size:10pt; margin:3px 0px 3px 0px; width:100%; border: solid black 1px; padding:0;}
26 td.params { background-color:lightgray; font-size:10pt; border: solid black 1px;}
28 h1 { text-decoration: underline; }
30 td.header { font-weight:bold; color:black; font-size:14pt; border-bottom: solid gray 2px}
31 td.label { vertical-align:top; padding-left:10pt; width:120pt; font-weight:normal; color:darkblue;}
32 td.value { vertical-align:top; text-align:left; font-weight: bold;}
33 span.subcode { color:darkblue;} </style>
39 <!--#if expr='"$QUERY_STRING" = /service=([^&]+)/' -->
40 <!--#set var="service" value="$1" -->
43 <!--#if expr="$QUERY_STRING = /param=%22([^&]+)%22/" -->
44 <!--#set var="param" value="$1" -->
47 <xsl:if test="not(res:content)">
48 <br/><br/><br/><br/><br/><br/>
49 <br/><br/><br/><br/><br/><br/>
52 <form method="GET" action='<!--#echo var="DOCUMENT_URI" -->' onsubmit='this.param.value = "\"" + this.param.value + "\"";'>
53 <xsl:if test="not(res:content)">
54 <xsl:attribute name="style">
55 <xsl:value-of select="'text-align:center;'"/>
59 <input name="service" type="text" value='<!--#echo var="service" -->'>
60 <xsl:if test="not(res:content)">
61 <xsl:attribute name="value">
62 <xsl:value-of select="''"/>
67 <input name="param" type="text" value='<!--#echo var="param" -->'>
68 <xsl:if test="not(res:content)">
69 <xsl:attribute name="value">
70 <xsl:value-of select="''"/>
74 <button name="method" value="opensrf.system.method">Find 'em</button>
77 <xsl:if test="res:content">
80 <xsl:apply-templates select="res:content/res:response"/>
83 <form method="GET" action='<!--#echo var="DOCUMENT_URI" -->' onsubmit='this.param.value = "\"" + this.param.value + "\"";'>
84 <xsl:if test="not(res:content)">
85 <xsl:attribute name="style">
86 <xsl:value-of select="'text-align:center;'"/>
90 <input name="service" type="text" value='<!--#echo var="service" -->'>
91 <xsl:if test="not(res:content)">
92 <xsl:attribute name="value">
93 <xsl:value-of select="''"/>
98 <input name="param" type="text" value='<!--#echo var="param" -->'>
99 <xsl:if test="not(res:content)">
100 <xsl:attribute name="value">
101 <xsl:value-of select="''"/>
105 <button name="method" value="opensrf.system.method">Find 'em</button>
113 <xsl:template match="res:api_name">
115 <xsl:attribute name="href">#<xsl:value-of select="./text()"/></xsl:attribute>
116 <xsl:value-of select="./text()"/>
121 <xsl:template match="res:response">
122 <xsl:if test="count(//res:api_name) > 1">
123 <h1>Method Index</h1>
124 <xsl:apply-templates select="//res:api_name"/>
126 <h1>Method Definitions</h1>
129 <xsl:apply-templates select="res:hash/res:pair[res:key/text()='payload']/res:value/res:array/res:datum/res:Object"/>
133 <xsl:template match="res:Object">
134 <xsl:if test="res:remote/text()='0'">
136 <xsl:if test="count(//res:api_name) > 1">
138 <xsl:attribute name="name"><xsl:value-of select="res:api_name/text()"/></xsl:attribute>
140 <a href="#top">Top</a>
145 <td colspan="3" class="header"><xsl:value-of select="res:api_name"/></td>
148 <td class="label">API Level:</td>
149 <td colspan="2" class="value"><xsl:value-of select="res:api_level"/></td>
152 <td class="label">Package:</td>
153 <td colspan="2" class="value"><xsl:value-of select="res:package"/></td>
156 <td class="label">Required argument count:</td>
157 <td colspan="2" class="value"><xsl:value-of select="res:argc"/></td>
159 <xsl:if test="normalize-space(res:signature/res:desc/text()) != normalize-space(res:notes/text())">
162 <xsl:attribute name='rowspan'>
163 <xsl:value-of select='count(res:signature/res:params/res:hash) + 6'/>
168 <xsl:apply-templates select="res:signature"/>
171 <td class="label">Streaming method:</td>
172 <td colspan="2" class="value">
173 <xsl:if test="res:stream/text()='1'">Yes</xsl:if>
174 <xsl:if test="res:stream/text()='0'">No</xsl:if>
177 <xsl:if test="res:notes">
179 <td class="label">Notes:</td>
180 <td colspan="2" class="value"><pre style="font-weight:normal;font-size:10px;"><xsl:value-of select="res:notes"/></pre></td>
188 <xsl:template match="res:pair">
190 <td class="label params">
191 <xsl:if test="res:key/text()='name'">Name:</xsl:if>
192 <xsl:if test="res:key/text()='desc'">Description:</xsl:if>
193 <xsl:if test="res:key/text()='type'">Data type:</xsl:if>
194 <xsl:if test="res:key/text()='class'">Object class:</xsl:if>
196 <td class="value params"><xsl:value-of select="res:value"/></td>
201 <xsl:template match="res:hash">
204 <table class="params">
205 <xsl:apply-templates select="res:pair[res:key/text()='name']"/>
206 <xsl:apply-templates select="res:pair[res:key/text()='desc']"/>
207 <xsl:apply-templates select="res:pair[res:key/text()='type']"/>
208 <xsl:apply-templates select="res:pair[res:key/text()='class']"/>
215 <xsl:template match="res:signature">
216 <xsl:if test="res:desc">
218 <td class="label">Description:</td>
219 <td class="value"><xsl:value-of select="res:desc"/></td>
222 <xsl:if test="res:params/res:hash">
225 <xsl:attribute name='rowspan'>
226 <xsl:value-of select='count(res:params/res:hash) + 1'/>
231 <xsl:apply-templates select="res:params/res:hash"/>
232 <xsl:if test="res:return">
234 <td class="label">Returns:</td>
235 <td class="value"><xsl:value-of select="res:return/res:desc"/></td>
238 <td class="label">Return type:</td>
239 <td class="value"><xsl:value-of select="res:return/res:type"/></td>
242 <td class="label">Return type class:</td>
243 <td class="value"><xsl:value-of select="res:return/res:class"/></td>
249 <!--#if expr="$QUERY_STRING = /param=%22[^&]+%22/" -->
250 <!--#if expr="$QUERY_STRING = /service=[^&]+/" -->
251 <content xmlns="http://example.com/test">
252 <!--#include virtual="/restgateway?${QUERY_STRING}"-->