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 = /all=on/" -->
44 <!--#set var="all" value="true" -->
46 <!--#set var="all" value="false" -->
49 <!--#if expr="$QUERY_STRING = /param=%22([^&]+)%22/" -->
50 <!--#set var="param" value="$1" -->
53 <xsl:if test="not(res:content)">
54 <br/><br/><br/><br/><br/><br/>
55 <br/><br/><br/><br/><br/><br/>
60 action='<!--#echo var="DOCUMENT_URI" -->'
62 this.param.value = "\"" + this.param.value + "\"";
63 if (this.all.checked) this.method.value = "opensrf.system.method.all";
65 <xsl:if test="not(res:content)">
66 <xsl:attribute name="style">
67 <xsl:value-of select="'text-align:center;'"/>
71 <input name="service" type="text" value='<!--#echo var="service" -->'>
72 <xsl:if test="not(res:content)">
73 <xsl:attribute name="value">
74 <xsl:value-of select="''"/>
78 API Method Name Regex:
79 <input name="param" type="text" value='<!--#echo var="param" -->'>
80 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
81 <xsl:attribute name="disabled">
82 <xsl:value-of select="'true'"/>
85 <xsl:if test="'<!--#echo var="param" -->' = '(none)'">
86 <xsl:attribute name="value">
87 <xsl:value-of select="''"/>
97 if (this.checked) this.form.param.disabled = true;
98 else this.form.param.disabled = false;
100 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
101 <xsl:attribute name="checked">
102 <xsl:value-of select="'checked'"/>
107 <button name="method" value="opensrf.system.method">Find 'em</button>
110 <xsl:if test="res:content">
113 <xsl:apply-templates select="res:content/res:response"/>
119 action='<!--#echo var="DOCUMENT_URI" -->'
121 this.param.value = "\"" + this.param.value + "\"";
122 if (this.all.checked) this.method.value = "opensrf.system.method.all";
124 <xsl:if test="not(res:content)">
125 <xsl:attribute name="style">
126 <xsl:value-of select="'text-align:center;'"/>
130 <input name="service" type="text" value='<!--#echo var="service" -->'>
131 <xsl:if test="not(res:content)">
132 <xsl:attribute name="value">
133 <xsl:value-of select="''"/>
137 API Method Name Regex:
138 <input name="param" type="text" value='<!--#echo var="param" -->'>
139 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
140 <xsl:attribute name="disabled">
141 <xsl:value-of select="'true'"/>
144 <xsl:if test="'<!--#echo var="param" -->' = '(none)'">
145 <xsl:attribute name="value">
146 <xsl:value-of select="''"/>
156 if (this.checked) this.form.param.disabled = true;
157 else this.form.param.disabled = false;
159 <xsl:if test="'<!--#echo var="all" -->' = 'true'">
160 <xsl:attribute name="checked">
161 <xsl:value-of select="'checked'"/>
166 <button name="method" value="opensrf.system.method">Find 'em</button>
174 <xsl:template match="res:api_name">
176 <xsl:attribute name="href">#<xsl:value-of select="./text()"/></xsl:attribute>
177 <xsl:value-of select="./text()"/>
182 <xsl:template match="res:response">
183 <xsl:if test="count(//res:api_name) > 1">
184 <h1>Method Index</h1>
185 <xsl:apply-templates select="//res:api_name"/>
187 <h1>Method Definitions</h1>
190 <xsl:apply-templates select="res:hash/res:pair[res:key/text()='payload']/res:value/res:array/res:datum/res:Object"/>
194 <xsl:template match="res:Object">
195 <xsl:if test="res:remote/text()='0'">
197 <xsl:if test="count(//res:api_name) > 1">
199 <xsl:attribute name="name"><xsl:value-of select="res:api_name/text()"/></xsl:attribute>
201 <a href="#top">Top</a>
206 <td colspan="3" class="header"><xsl:value-of select="res:api_name"/></td>
209 <td class="label">API Level:</td>
210 <td colspan="2" class="value"><xsl:value-of select="res:api_level"/></td>
213 <td class="label">Package:</td>
214 <td colspan="2" class="value"><xsl:value-of select="res:package"/></td>
217 <td class="label">Required argument count:</td>
218 <td colspan="2" class="value"><xsl:value-of select="res:argc"/></td>
220 <xsl:if test="normalize-space(res:signature/res:desc/text()) != normalize-space(res:notes/text())">
223 <xsl:attribute name='rowspan'>
224 <xsl:value-of select='count(res:signature/res:params/res:hash) + 6'/>
229 <xsl:apply-templates select="res:signature"/>
232 <td class="label">Streaming method:</td>
233 <td colspan="2" class="value">
234 <xsl:if test="res:stream/text()='1'">Yes</xsl:if>
235 <xsl:if test="res:stream/text()='0'">No</xsl:if>
238 <xsl:if test="res:notes">
240 <td class="label">Notes:</td>
241 <td colspan="2" class="value"><pre style="font-weight:normal;font-size:10px;"><xsl:value-of select="res:notes"/></pre></td>
249 <xsl:template match="res:pair">
251 <td class="label params">
252 <xsl:if test="res:key/text()='name'">Name:</xsl:if>
253 <xsl:if test="res:key/text()='desc'">Description:</xsl:if>
254 <xsl:if test="res:key/text()='type'">Data type:</xsl:if>
255 <xsl:if test="res:key/text()='class'">Object class:</xsl:if>
257 <td class="value params"><xsl:value-of select="res:value"/></td>
262 <xsl:template match="res:hash">
265 <table class="params">
266 <xsl:apply-templates select="res:pair[res:key/text()='name']"/>
267 <xsl:apply-templates select="res:pair[res:key/text()='desc']"/>
268 <xsl:apply-templates select="res:pair[res:key/text()='type']"/>
269 <xsl:apply-templates select="res:pair[res:key/text()='class']"/>
276 <xsl:template match="res:signature">
277 <xsl:if test="res:desc">
279 <td class="label">Description:</td>
280 <td class="value"><xsl:value-of select="res:desc"/></td>
283 <xsl:if test="res:params/res:hash">
286 <xsl:attribute name='rowspan'>
287 <xsl:value-of select='count(res:params/res:hash) + 1'/>
292 <xsl:apply-templates select="res:params/res:hash"/>
293 <xsl:if test="res:return">
295 <td class="label">Returns:</td>
296 <td class="value"><xsl:value-of select="res:return/res:desc"/></td>
299 <td class="label">Return type:</td>
300 <td class="value"><xsl:value-of select="res:return/res:type"/></td>
303 <td class="label">Return type class:</td>
304 <td class="value"><xsl:value-of select="res:return/res:class"/></td>
310 <!--#if expr="$QUERY_STRING = /service=[^&]+/" -->
311 <!--#if expr="$QUERY_STRING = /param=%22[^&]+%22/" -->
312 <content xmlns="http://example.com/test">
313 <!--#include virtual="/restgateway?${QUERY_STRING}"-->
316 <!--#if expr="$QUERY_STRING = /all=on/" -->
317 <content xmlns="http://example.com/test">
318 <!--#include virtual="/restgateway?${QUERY_STRING}"-->