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" = /limit=([^&]+)/' -->
40 <!--#set var="limit" value="$1" -->
42 <!--#set var="limit" value="10" -->
45 <!--#if expr='"$QUERY_STRING" = /offset=([^&]+)/' -->
46 <!--#set var="offset" value="$1" -->
48 <!--#set var="offset" value="0" -->
51 <!--#if expr='"$QUERY_STRING" = /service=([^&]+)/' -->
52 <!--#set var="service" value="$1" -->
54 <!--#set var="service" value="" -->
57 <!--#if expr='"$QUERY_STRING" = /method=([^&]+)/' -->
58 <!--#set var="method" value="$1" -->
61 <!--#if expr="$QUERY_STRING = /all=on/" -->
62 <!--#set var="all" value="true" -->
64 <!--#set var="all" value="false" -->
67 <!--#if expr="$QUERY_STRING = /param=%22([^&]+)%22/" -->
68 <!--#set var="param" value="$1" -->
70 <!--#set var="param" value="" -->
73 <xsl:if test="not(res:content/res:response)">
74 <br/><br/><br/><br/><br/><br/>
75 <br/><br/><br/><br/><br/><br/>
80 action='<!--#echo var="DOCUMENT_URI" -->'
82 this.param.value = "\"" + this.param.value + "\"";
83 if (this.all.checked) this.method.value = "opensrf.system.method.all";
85 <xsl:if test="not(res:content/res:response)">
86 <xsl:attribute name="style">
87 <xsl:value-of select="'text-align:center;'"/>
91 <input name="service" type="text" value='<!--#echo var="service" -->'/> 
92 API Method Name Regex:
93 <input name="param" type="text" value='<!--#echo var="param" -->'>
94 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
95 <xsl:attribute name="disabled">
96 <xsl:value-of select="'true'"/>
100 All Methods (Use with care!)
106 if (this.checked) this.form.param.disabled = true;
107 else this.form.param.disabled = false;
109 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
110 <xsl:attribute name="checked">
111 <xsl:value-of select="'checked'"/>
116 <button name="method" value="opensrf.system.method">Find 'em</button>
119 <xsl:if test="res:content/res:response">
122 <xsl:apply-templates select="res:content/res:response"/>
128 action='<!--#echo var="DOCUMENT_URI" -->'
130 this.param.value = "\"" + this.param.value + "\"";
131 if (this.all.checked) this.method.value = "opensrf.system.method.all";
133 <xsl:if test="not(res:content/res:response)">
134 <xsl:attribute name="style">
135 <xsl:value-of select="'text-align:center;'"/>
139 <input name="service" type="text" value='<!--#echo var="service" -->'/> 
140 API Method Name Regex:
141 <input name="param" type="text" value='<!--#echo var="param" -->'>
142 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
143 <xsl:attribute name="disabled">
144 <xsl:value-of select="'true'"/>
148 All Methods (Use with care!)
154 if (this.checked) this.form.param.disabled = true;
155 else this.form.param.disabled = false;
157 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
158 <xsl:attribute name="checked">
159 <xsl:value-of select="'checked'"/>
164 <button name="method" value="opensrf.system.method">Find 'em</button>
172 <xsl:template match="res:api_name">
173 API Level: <xsl:value-of select="../res:api_level/text()"/> / Method:
175 <xsl:attribute name="href">#<xsl:value-of select="./text()"/></xsl:attribute>
176 <xsl:value-of select="./text()"/>
181 <xsl:template match="res:response">
183 <xsl:when test="count(//res:api_name) > 1">
184 <h1>Matching Methods</h1>
185 <xsl:apply-templates select="//res:api_name">
186 <xsl:sort select="text()"/>
187 </xsl:apply-templates>
189 <h1>Method Definitions</h1>
191 <xsl:when test="count(//res:api_name) = 0">
192 <h1><i>No Matching Methods Found</i></h1>
196 <xsl:apply-templates select="res:hash/res:pair[res:key/text()='payload']/res:value/res:array/res:datum/res:Object">
197 <xsl:sort select="res:api_name/text()"/>
198 </xsl:apply-templates>
202 <xsl:template match="res:Object">
203 <xsl:if test="res:remote/text()='0'">
205 <xsl:if test="count(//res:api_name) > 1">
207 <xsl:attribute name="name"><xsl:value-of select="res:api_name/text()"/></xsl:attribute>
209 <a href="#top">Top</a>
214 <td colspan="3" class="header"><xsl:value-of select="res:api_name"/></td>
217 <td class="label">API Level:</td>
218 <td colspan="2" class="value"><xsl:value-of select="res:api_level"/></td>
221 <td class="label">Package:</td>
222 <td colspan="2" class="value"><xsl:value-of select="res:package"/></td>
225 <td class="label">Required argument count:</td>
226 <td colspan="2" class="value"><xsl:value-of select="res:argc"/></td>
228 <xsl:if test="normalize-space(res:signature/res:desc/text()) != normalize-space(res:notes/text())">
231 <xsl:attribute name='rowspan'>
232 <xsl:value-of select='count(res:signature/res:params/res:hash) + 6'/>
237 <xsl:apply-templates select="res:signature"/>
240 <td class="label">Streaming method:</td>
241 <td colspan="2" class="value">
242 <xsl:if test="res:stream/text()='1'">Yes</xsl:if>
243 <xsl:if test="res:stream/text()='0'">No</xsl:if>
246 <xsl:if test="res:notes">
248 <td class="label">Notes:</td>
249 <td colspan="2" class="value"><pre style="font-weight:normal;font-size:10px;"><xsl:value-of select="res:notes"/></pre></td>
257 <xsl:template match="res:pair">
259 <td class="label params">
260 <xsl:if test="res:key/text()='name'">Name:</xsl:if>
261 <xsl:if test="res:key/text()='desc'">Description:</xsl:if>
262 <xsl:if test="res:key/text()='type'">Data type:</xsl:if>
263 <xsl:if test="res:key/text()='class'">Object class:</xsl:if>
265 <td class="value params"><xsl:value-of select="res:value"/></td>
270 <xsl:template match="res:hash">
273 <table class="params">
275 <td class="label params">Position:</td>
276 <td class="value params"><xsl:value-of select="position()"/></td>
278 <xsl:apply-templates select="res:pair[res:key/text()='name']"/>
279 <xsl:apply-templates select="res:pair[res:key/text()='desc']"/>
280 <xsl:apply-templates select="res:pair[res:key/text()='type']"/>
281 <xsl:apply-templates select="res:pair[res:key/text()='class']"/>
288 <xsl:template match="res:signature">
289 <xsl:if test="res:desc">
291 <td class="label">Description:</td>
292 <td class="value"><xsl:value-of select="res:desc"/></td>
295 <xsl:if test="res:params/res:hash">
298 <xsl:attribute name='rowspan'>
299 <xsl:value-of select='count(res:params/res:hash) + 1'/>
304 <xsl:apply-templates select="res:params/res:hash">
305 <xsl:sort select="position()"/>
306 </xsl:apply-templates>
307 <xsl:if test="res:return">
309 <td class="label">Returns:</td>
310 <td class="value"><xsl:value-of select="res:return/res:desc"/></td>
313 <td class="label">Return type:</td>
314 <td class="value"><xsl:value-of select="res:return/res:type"/></td>
317 <td class="label">Return type class:</td>
318 <td class="value"><xsl:value-of select="res:return/res:class"/></td>
324 <!--#if expr="$QUERY_STRING = /service=[^&]+/" -->
325 <!--#if expr="$QUERY_STRING = /param=%22[^&]+%22/" -->
326 <content xmlns="http://example.com/test">
327 <!--#include virtual="/restgateway?${QUERY_STRING}"-->
328 <!-- virtual='/restgateway?service=$service&method=$method¶m="$param"¶m=$limit¶m=$offset'-->
331 <!--#if expr="$QUERY_STRING = /all=on/" -->
332 <content xmlns="http://example.com/test">
333 <!--#include virtual="/restgateway?${QUERY_STRING}"-->
334 <!-- virtual='/restgateway?service=$service&method=$method¶m=""¶m=$limit¶m=$offset' -->