File: html_plain.xsl

package info (click to toggle)
virtuoso-opensource 6.1.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 213,384 kB
  • ctags: 120,485
  • sloc: ansic: 631,183; sql: 420,245; xml: 272,257; java: 62,959; sh: 39,240; cpp: 37,890; cs: 24,942; php: 12,251; yacc: 8,812; lex: 7,135; makefile: 6,331; jsp: 3,739; asm: 3,281; ada: 1,681; awk: 1,639; pascal: 1,089; perl: 1,017; ruby: 1,000; python: 329
file content (351 lines) | stat: -rw-r--r-- 13,893 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'>

<xsl:output method="html" 
  doctype-public="-//W3C//DTD HTML 3.2 Final//EN" />

<xsl:include href="html_functions.xsl"/>

<xsl:strip-space elements="para listitem itemizedlist orderedlist" />

<!-- ==================================================================== -->

			<!-- Variables -->
	<xsl:param name="imgroot">../images/</xsl:param>
			<!-- Variables -->

<!-- ==================================================================== -->

<xsl:template match="/">
  <HTML><HEAD>
  <!-- LINK REL="stylesheet" TYPE="text/css" HREF="virtdoc.css"/ not allowed for htmldoc -->
  <TITLE><xsl:value-of select="/book/title"/></TITLE>
  <META NAME="AUTHOR"><xsl:attribute name="CONTENT"><xsl:apply-templates select="/book/bookinfo/authorgroup/author" /></xsl:attribute></META>
  <META NAME="COPYRIGHT"><xsl:attribute name="CONTENT"><xsl:value-of select="/book/bookinfo/copyright/holder" /><xsl:text>, </xsl:text><xsl:value-of select="/book/bookinfo/copyright/year" /></xsl:attribute></META>
  <META NAME="KEYWORDS" CONTENT="Virtuoso;OpenLink;Database;UDA;Web Server" />
  <META NAME="GENERATOR" CONTENT="OpenLink designed XSLT sheets and XT" />
  </HEAD>

  <BODY>

  <xsl:apply-templates select="/book/chapter"/> 

<!-- Apendix sections -->

<xsl:if test="/book/chapter[@id='functions']">

<A NAME="functionindex" />

<H1>Function Index</H1>

<TABLE CLASS="data" BORDER="1" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD bgcolor="#eeeeee"><B>Function Name</B></TD>
<TD bgcolor="#eeeeee"><B>Description</B></TD>
<TD bgcolor="#eeeeee"><B>Function Syntax</B></TD>
</TR>
<xsl:for-each select="/book/chapter[./@id='functions']//refentry">
<xsl:sort select="@id" data-type="text"/>
	<xsl:variable name="currentfn"><xsl:value-of select="@id" /></xsl:variable>
	
<TR><TD>
<A><xsl:attribute name="HREF">#<xsl:value-of select="./@id" /></xsl:attribute>
	<xsl:value-of select="./refmeta/refentrytitle" /></A>
</TD>
<TD><xsl:value-of select="./refnamediv/refpurpose" /></TD>
<TD><xsl:apply-templates select="refsynopsisdiv/funcsynopsis"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:if>

<!-- Normal Doc Content -->

<DIV CLASS="vtabfoot"> - Copyright <xsl:value-of select="/book/bookinfo/copyright/year"/>, <xsl:value-of select="/book/bookinfo/copyright/holder"/> - </DIV>
  </BODY></HTML>
</xsl:template>

<xsl:template match="chapter/abstract" />
<xsl:template match="chapter/title" />
<xsl:template match="chapter/bridgehead" />

<xsl:template match="sect1">
<xsl:comment> NEED 15 </xsl:comment> <!-- Added for PDF formatting -->
   <xsl:apply-templates />
<BR />
</xsl:template>

<xsl:template match="sect2|sect3|sect4|sect5|section">
<xsl:comment> NEED 15 </xsl:comment> <!-- Added for PDF formatting -->
   <xsl:apply-templates />
</xsl:template>

<xsl:template match="sect1/title"><H2 CLASS="sect1head"><A><xsl:attribute name="NAME"><xsl:value-of select="../@id" /></xsl:attribute><xsl:apply-templates /></A></H2></xsl:template>
<xsl:template match="sect2/title"><H3 CLASS="sect2head"><A><xsl:attribute name="NAME"><xsl:value-of select="../@id" /></xsl:attribute><xsl:apply-templates /></A></H3></xsl:template>
<xsl:template match="sect3/title"><H4 CLASS="sect3head"><A><xsl:attribute name="NAME"><xsl:value-of select="../@id" /></xsl:attribute><xsl:apply-templates /></A></H4></xsl:template>
<xsl:template match="sect4/title"><H5 CLASS="sect4head"><A><xsl:attribute name="NAME"><xsl:value-of select="../@id" /></xsl:attribute><xsl:apply-templates /></A></H5></xsl:template>
<xsl:template match="sect5/title"><H6 CLASS="sect5head"><A><xsl:attribute name="NAME"><xsl:value-of select="../@id" /></xsl:attribute><xsl:apply-templates /></A></H6></xsl:template>

<xsl:template match="screen|programlisting">
  <TABLE BORDER="0" WIDTH="90%"><TR><TD BGCOLOR="#f0f0f0"><PRE><xsl:value-of select="." /></PRE></TD></TR></TABLE><BR/></xsl:template>

<xsl:template match="constant|literal|type|computeroutput|para/parameter|para/function|para/programlisting|para/screen|member/parameter|member/function|member/programlisting|member/screen">
  <code><xsl:apply-templates /></code></xsl:template>

<xsl:template match="para"><P><xsl:apply-templates /></P></xsl:template>
<xsl:template match="example/title"><DIV CLASS="exampletitle"><xsl:apply-templates /></DIV></xsl:template>
<xsl:template match="example"><DIV CLASS="example"><xsl:apply-templates /></DIV></xsl:template>

<xsl:template match="formalpara">
<xsl:if test="@id"><A><xsl:attribute name="NAME">fp_<xsl:value-of select="@id" /></xsl:attribute></A></xsl:if>
<P><xsl:apply-templates /></P>
</xsl:template>

<xsl:template match="formalpara/title"><STRONG><xsl:apply-templates /></STRONG></xsl:template>

<xsl:template match="emphasis"><STRONG><xsl:apply-templates/></STRONG></xsl:template>

<xsl:template match="quote">&quot;<xsl:apply-templates/>&quot;</xsl:template>

<xsl:template match="ulink">
  <A>
    <xsl:attribute name="HREF"><xsl:value-of select="@url"/></xsl:attribute>
    <xsl:apply-templates/>
  </A>
</xsl:template>

<xsl:template match="refsect1[starts-with(@id, 'errors')]/errorcode" />

<xsl:template match="cmdsynopsis">
<PRE CLASS="programlisting">
  <xsl:for-each select="command" >
    <xsl:value-of select="." />
  </xsl:for-each>
  <xsl:for-each select="arg" >
		<xsl:apply-templates />
  </xsl:for-each>
</PRE>
</xsl:template>

<xsl:template match="important">
<SPAN CLASS="important"><STRONG>Important:</STRONG><xsl:text> </xsl:text><xsl:apply-templates/></SPAN>
</xsl:template>

<xsl:template match="variablelist">
<TABLE CLASS="varlist">
<xsl:for-each select="varlistentry">
<TR><TD ALIGN="right" VALIGN="top" CLASS="varterm"><xsl:attribute name="NOWRAP">NOWRAP</xsl:attribute><xsl:value-of select="term" />:</TD>
<TD>
  <xsl:for-each select="listitem" >
    <xsl:apply-templates />
  </xsl:for-each>
</TD></TR>
</xsl:for-each>
</TABLE>
</xsl:template>

<xsl:template match="simplelist">
<!-- no support for multiple columns -->
<UL><xsl:apply-templates select="member" /></UL>
</xsl:template>

<xsl:template match="orderedlist">
<!-- no support for multiple columns -->
<OL><xsl:apply-templates select="listitem" /></OL></xsl:template>

<xsl:template match="itemizedlist"><UL><xsl:apply-templates /></UL></xsl:template>

<xsl:template match="listitem|member"><LI><xsl:apply-templates /></LI></xsl:template>

<xsl:template match="author"><xsl:value-of select="./firstname" /><xsl:text> </xsl:text><xsl:value-of select="./surname" />;</xsl:template>

<xsl:template match="author/firstname|author/surname|docinfo" />

<xsl:template match="msg|msgmain|msgtext"><xsl:apply-templates /></xsl:template>
<xsl:template match="msgset|msgentry|msg|msgexplain">
  <DIV class="{name(.)}"><xsl:apply-templates><xsl:sort select="msgentry/msg/msgmain/msgtext/errorcode"/></xsl:apply-templates></DIV></xsl:template>
<xsl:template match="msgset/title"><A name="{../@id}" /><DIV class="msgsettitle"><xsl:apply-templates /></DIV></xsl:template>
<xsl:template match="errorcode"><A name="err{.}" /><SPAN class="{name(.)}"><xsl:apply-templates /></SPAN></xsl:template>
<xsl:template match="errortype|errorname"><SPAN class="{name(.)}"><xsl:apply-templates /></SPAN></xsl:template>

<xsl:template match="chapter[./@id!='functions']">
  <H1><A name="{@id}"><xsl:value-of select="./title" /></A></H1>

<DIV CLASS="abstract">
<DIV CLASS="abstracttxt">
   <xsl:apply-templates select="abstract/*" />
</DIV>
</DIV>

  <xsl:apply-templates />

</xsl:template>

<xsl:template match="chapter[./@id='functions']">
  <H1><A name="{@id}"><xsl:value-of select="./title" /></A></H1>

<DIV CLASS="abstract">
<DIV CLASS="abstracttxt">
   <xsl:apply-templates select="abstract/*" />
</DIV>
</DIV>

<xsl:for-each select="docinfo/keywordset/keyword" ><xsl:sort select="." data-type="text"/>
  <h2><xsl:value-of select="." /></h2>
  <xsl:variable name="funccat" select="@id"/>
  <xsl:for-each select="/book/chapter[@id = 'functions']/refentry[refmeta/refmiscinfo = $funccat]"><xsl:sort select="@id" />
    <xsl:apply-templates select="."/>
  </xsl:for-each>
</xsl:for-each>

</xsl:template>

<!-- <xsl:template match="para"><P CLASS="para"><xsl:apply-templates /></P></xsl:template> -->

<!-- <xsl:template match="refentry">
<A><xsl:attribute name="NAME"><xsl:value-of select="@id"/></xsl:attribute></A>
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2" WIDTH="95%" CLASS="refentry">
<TR CLASS="refentry">
<TD><IMG WIDTH="10px" HEIGHT="10px"><xsl:attribute name="SRC"><xsl:value-of select="$imgroot"/>misc/1x1.gif</xsl:attribute></IMG></TD>
<TD ALIGN="right">
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="2"><TR>
<TD CLASS="refentrytitle"><xsl:value-of select="refmeta/refentrytitle"/></TD>
<TD WIDTH="300px" CLASS="refpurpose" ALIGN="left"><xsl:apply-templates select="refnamediv/refpurpose"/></TD>
</TR>
</TABLE></TD></TR>
	<xsl:for-each select="refsynopsisdiv/funcsynopsis">
	<xsl:sort select="funcdef/function" data-type="text"/>
<TR><TD><IMG WIDTH="10px" HEIGHT="10px"><xsl:attribute name="SRC"><xsl:value-of select="$imgroot"/>misc/1x1.gif</xsl:attribute></IMG></TD>
<TD CLASS="funcsynopsis"><xsl:apply-templates/></TD></TR>
	</xsl:for-each>
<TR><TD COLSPAN="2" CLASS="refdesc">
<xsl:apply-templates select="refsect1"/>
</TD></TR>
</TABLE>
<BR />
</xsl:template>
-->
<xsl:template match="table">
<xsl:comment> NEED 15 </xsl:comment>
  <BR />
   <TABLE border="0" cellspacing="0" cellpadding="2">
   <TR><TD><TABLE BORDER="1" CELLSPACING="1" CELLPADDING="2">
   <xsl:if test="./tgroup/thead">
     <TR><xsl:for-each select="./tgroup/thead/row/entry"><TD bgcolor="#eeeeee"><B><xsl:value-of select="." /></B></TD></xsl:for-each></TR>
   </xsl:if>

   <xsl:for-each select="./tgroup/tbody/row" >
     <TR>
     <xsl:for-each select="entry" >
       <TD>
       <xsl:choose>
         <xsl:when test="./para"><xsl:apply-templates /></xsl:when>
         <xsl:when test="not(child::node())">&#160;</xsl:when>
         <xsl:otherwise><DIV CLASS="para"><xsl:value-of select="." /></DIV></xsl:otherwise>
       </xsl:choose>
         <!-- <xsl:apply-templates /> -->
       </TD>
     </xsl:for-each>
     </TR>
   </xsl:for-each> 
   </TABLE></TD></TR>

   <xsl:if test="./title">
     <TR>
   	<TD>
   	<xsl:attribute name="COLSPAN"><xsl:value-of select="./tgroup/@cols" /></xsl:attribute>
   	<I><xsl:value-of select="./title"/></I>
     	</TD></TR>
   </xsl:if>
   </TABLE>
   <BR/>
</xsl:template>

<xsl:template match="figure">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR>
<TD><IMG>
	<xsl:attribute name="TITLE"><xsl:value-of select="title" /></xsl:attribute>
	<xsl:attribute name="SRC"><xsl:value-of select="$imgroot"/><xsl:value-of select="graphic/@fileref"/></xsl:attribute>
  </IMG></TD></TR>
<TR><TD><I><xsl:value-of select="./title"/></I></TD></TR>
</TABLE><BR />
</xsl:template>

<xsl:template match="note|tip">
<TABLE BORDER="1" WIDTH="610" CELLPADDING="5"><TR><TD ALIGN="left">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="5" WIDTH="600">
<TR><TD WIDTH="70" ALIGN="right" VALIGN="top"><STRONG><xsl:value-of select="./title" /></STRONG></TD>
<TD ALIGN="left" WIDTH="500"><xsl:apply-templates /></TD>
</TR></TABLE>
</TD></TR></TABLE>
<BR />
</xsl:template>

<xsl:template match="refsect1|refsect2|refsect3"><DIV><xsl:apply-templates/></DIV></xsl:template>
<xsl:template match="refsect1/title|refsect2/title|refsect3/title"><STRONG><xsl:apply-templates/></STRONG><br /></xsl:template>

<xsl:template match="note/title|tip/title" />

<xsl:template match="refentry">
<xsl:comment> NEED 30 </xsl:comment>
<br />
<A><xsl:attribute name="NAME"><xsl:value-of select="@id"/></xsl:attribute></A>
<xsl:choose>
 <xsl:when test="../@id='functions' and name(..)='chapter'"><h3><xsl:value-of select="refmeta/refentrytitle" /></h3></xsl:when>
 <xsl:otherwise><DIV CLASS="refentrytitle"><FONT SIZE="4"><STRONG><xsl:value-of select="refmeta/refentrytitle" /></STRONG></FONT></DIV></xsl:otherwise>
</xsl:choose>
<DIV CLASS="refpurpose"><xsl:apply-templates select="refnamediv/refpurpose"/></DIV>
	<xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
	<xsl:sort select="funcdef/function" data-type="text"/>
<div><code><xsl:apply-templates/></code></div>
<br />
	</xsl:for-each>
<xsl:apply-templates />
</xsl:template>

<xsl:template match="refsect2"><DIV CLASS="refsect2"><xsl:apply-templates/></DIV></xsl:template>

<xsl:template match="refsect1[starts-with(@id, 'errors')]">
  <xsl:apply-templates />
  <P>
  <xsl:for-each select="errorcode">
  <xsl:sort select="." />
  <A href="#err{.}"><xsl:apply-templates/></A>
  <xsl:choose>
    <xsl:when test="following-sibling::errorcode">
      <xsl:text>, </xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>.</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
  </xsl:for-each>
  </P>
</xsl:template>


<xsl:template match="link">
  <xsl:variable name="targets" select="id(@linkend)"/>
  <xsl:variable name="target" select="$targets[1]"/>
<A>
  <xsl:for-each select="$target">
    <xsl:variable name="currentid" select="$target/@id"/>
    <xsl:variable name="node" select="."/>
    <xsl:attribute name="HREF">
      <xsl:choose>
        <xsl:when test="name($node)='formalpara'">#fp_<xsl:value-of select="./@id"/></xsl:when>
        <xsl:when test="name($node)='chapter'">#<xsl:value-of select="@id"/></xsl:when>
        <xsl:when test="name($node)='sect1'">#<xsl:value-of select="./@id"/></xsl:when>
        <xsl:when test="name($node)='sect2'">#<xsl:value-of select="./@id"/></xsl:when>
        <xsl:when test="name($node)='sect3'">#<xsl:value-of select="./@id"/></xsl:when>
        <xsl:when test="name($node)='sect4'">#<xsl:value-of select="./@id"/></xsl:when>
        <xsl:when test="name($node)='refentry'">#<xsl:value-of select="./@id"/></xsl:when>
      </xsl:choose>
    </xsl:attribute>
  </xsl:for-each>
  <xsl:apply-templates/>
</A>
</xsl:template>

</xsl:stylesheet>