1 | <?xml version='1.0'?>
|
---|
2 | <!DOCTYPE xsl:stylesheet [ <!ENTITY % xsldoc.ent SYSTEM "./xsldoc.ent"> %xsldoc.ent; ]>
|
---|
3 | <!--#############################################################################
|
---|
4 | | $Id: pi.mod.xsl,v 1.6 2004/01/01 11:37:00 j-devenish Exp $
|
---|
5 | |- #############################################################################
|
---|
6 | | $Author: j-devenish $
|
---|
7 | + ############################################################################## -->
|
---|
8 |
|
---|
9 | <xsl:stylesheet
|
---|
10 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
11 | xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
---|
12 | exclude-result-prefixes="doc" version='1.0'>
|
---|
13 |
|
---|
14 | <doc:reference id="pi" xmlns="">
|
---|
15 | <referenceinfo>
|
---|
16 | <releaseinfo role="meta">
|
---|
17 | $Id: pi.mod.xsl,v 1.6 2004/01/01 11:37:00 j-devenish Exp $
|
---|
18 | </releaseinfo>
|
---|
19 | <authorgroup>
|
---|
20 | &ramon;
|
---|
21 | &james;
|
---|
22 | </authorgroup>
|
---|
23 | <copyright>
|
---|
24 | <year>2000</year><year>2001</year><year>2002</year><year>2003</year><year>2004</year>
|
---|
25 | <holder>Ramon Casellas</holder>
|
---|
26 | </copyright>
|
---|
27 | <revhistory>
|
---|
28 | <doc:revision rcasver="1.12">&rev_2003_05;</doc:revision>
|
---|
29 | </revhistory>
|
---|
30 | </referenceinfo>
|
---|
31 | <title>Processing Instructions <filename>pi.mod.xsl</filename></title>
|
---|
32 | <partintro>
|
---|
33 | <para>
|
---|
34 |
|
---|
35 | Some processing instructions are handled by templates in this file
|
---|
36 | while other are present in <xref linkend="figure"/>, <xref
|
---|
37 | linkend="biblio"/> and <xref linkend="index"/>.
|
---|
38 |
|
---|
39 | </para>
|
---|
40 | </partintro>
|
---|
41 | </doc:reference>
|
---|
42 |
|
---|
43 | <doc:template xmlns="">
|
---|
44 | <refpurpose> Process generic processing instructions </refpurpose>
|
---|
45 | <doc:description>
|
---|
46 | <para>
|
---|
47 |
|
---|
48 | Processing instructions are allowed but are ignored unless they
|
---|
49 | have a &DB2LaTeX;-specific name.
|
---|
50 |
|
---|
51 | </para>
|
---|
52 | </doc:description>
|
---|
53 | <doc:variables>
|
---|
54 | &no_var;
|
---|
55 | </doc:variables>
|
---|
56 | <doc:notes>
|
---|
57 | <para>This template suppresses processing instructions.</para>
|
---|
58 | </doc:notes>
|
---|
59 | </doc:template>
|
---|
60 | <xsl:template match="processing-instruction()"/>
|
---|
61 |
|
---|
62 | <doc:template xmlns="">
|
---|
63 | <refpurpose> Output arbitrary &LaTeX; text </refpurpose>
|
---|
64 | <doc:description>
|
---|
65 | <para>
|
---|
66 |
|
---|
67 | The contents of this processing instruction will
|
---|
68 | output directly by &DB2LaTeX;. This allows the
|
---|
69 | inclusion of &latex;-specific instructions that
|
---|
70 | will be recognised only by &latex; stylesheets.
|
---|
71 | For example, <literal><![CDATA[<?latex \sloppy?>]]></literal>
|
---|
72 | would insert <literal>\sloppy</literal> into the output
|
---|
73 | without any character escaping.
|
---|
74 |
|
---|
75 | </para>
|
---|
76 | </doc:description>
|
---|
77 | <doc:variables>
|
---|
78 | &no_var;
|
---|
79 | </doc:variables>
|
---|
80 | </doc:template>
|
---|
81 | <xsl:template match="processing-instruction('latex')">
|
---|
82 | <xsl:value-of select="."/>
|
---|
83 | </xsl:template>
|
---|
84 |
|
---|
85 | <doc:template xmlns="">
|
---|
86 | <refpurpose> Output arbitrary &LaTeX; text </refpurpose>
|
---|
87 | <doc:description>
|
---|
88 | <para>
|
---|
89 |
|
---|
90 | The contents of this processing instruction will
|
---|
91 | output directly by &DB2LaTeX;. This allows the
|
---|
92 | inclusion of &latex;-specific instructions that
|
---|
93 | will be recognised only by &latex; stylesheets.
|
---|
94 | For example, <literal><![CDATA[<?latex \sloppy?>]]></literal>
|
---|
95 | would insert <literal>\sloppy</literal> into the output
|
---|
96 | without any character escaping.
|
---|
97 |
|
---|
98 | </para>
|
---|
99 | </doc:description>
|
---|
100 | <doc:variables>
|
---|
101 | &no_var;
|
---|
102 | </doc:variables>
|
---|
103 | </doc:template>
|
---|
104 | <xsl:template match="processing-instruction('db2latex')">
|
---|
105 | <xsl:value-of select="."/>
|
---|
106 | </xsl:template>
|
---|
107 |
|
---|
108 | <xsl:template match="processing-instruction('rcas')">
|
---|
109 | <xsl:processing-instruction name="dbhtml">
|
---|
110 | <xsl:value-of select="."/>
|
---|
111 | </xsl:processing-instruction>
|
---|
112 | </xsl:template>
|
---|
113 |
|
---|
114 | <xsl:template name="process.cmdsynopsis.list">
|
---|
115 | <xsl:param name="cmdsynopses"/><!-- empty node list by default -->
|
---|
116 | <xsl:param name="count" select="1"/>
|
---|
117 |
|
---|
118 | <xsl:choose>
|
---|
119 | <xsl:when test="$count>count($cmdsynopses)"></xsl:when>
|
---|
120 | <xsl:otherwise>
|
---|
121 | <xsl:variable name="cmdsyn" select="$cmdsynopses[$count]"/>
|
---|
122 |
|
---|
123 | <dt>
|
---|
124 | <a>
|
---|
125 | <xsl:attribute name="href">
|
---|
126 | <xsl:call-template name="label.id">
|
---|
127 | <xsl:with-param name="object" select="$cmdsyn"/>
|
---|
128 | </xsl:call-template>
|
---|
129 | </xsl:attribute>
|
---|
130 |
|
---|
131 | <xsl:choose>
|
---|
132 | <xsl:when test="$cmdsyn/@xreflabel">
|
---|
133 | <xsl:call-template name="xref.xreflabel">
|
---|
134 | <xsl:with-param name="target" select="$cmdsyn"/>
|
---|
135 | </xsl:call-template>
|
---|
136 | </xsl:when>
|
---|
137 | <xsl:otherwise>
|
---|
138 | <!-- RCAS Fixme
|
---|
139 | <xsl:call-template name="xref.cmdsynopsis">
|
---|
140 | <xsl:with-param name="target" select="$cmdsyn"/>
|
---|
141 | </xsl:call-template>-->
|
---|
142 | </xsl:otherwise>
|
---|
143 | </xsl:choose>
|
---|
144 | </a>
|
---|
145 | </dt>
|
---|
146 |
|
---|
147 | <xsl:call-template name="process.cmdsynopsis.list">
|
---|
148 | <xsl:with-param name="cmdsynopses" select="$cmdsynopses"/>
|
---|
149 | <xsl:with-param name="count" select="$count+1"/>
|
---|
150 | </xsl:call-template>
|
---|
151 | </xsl:otherwise>
|
---|
152 | </xsl:choose>
|
---|
153 | </xsl:template>
|
---|
154 |
|
---|
155 | <xsl:template match="processing-instruction('dbcmdlist')">
|
---|
156 | <xsl:variable name="cmdsynopses" select="..//cmdsynopsis"/>
|
---|
157 |
|
---|
158 | <xsl:if test="count($cmdsynopses)<1">
|
---|
159 | <xsl:message><xsl:text>No cmdsynopsis elements matched dbcmdlist PI, perhaps it's nested too deep?</xsl:text>
|
---|
160 | </xsl:message>
|
---|
161 | </xsl:if>
|
---|
162 |
|
---|
163 | <dl>
|
---|
164 | <xsl:call-template name="process.cmdsynopsis.list">
|
---|
165 | <xsl:with-param name="cmdsynopses" select="$cmdsynopses"/>
|
---|
166 | </xsl:call-template>
|
---|
167 | </dl>
|
---|
168 | </xsl:template>
|
---|
169 |
|
---|
170 | <!-- ==================================================================== -->
|
---|
171 |
|
---|
172 | <xsl:template name="process.funcsynopsis.list">
|
---|
173 | <xsl:param name="funcsynopses"/><!-- empty node list by default -->
|
---|
174 | <xsl:param name="count" select="1"/>
|
---|
175 |
|
---|
176 | <xsl:choose>
|
---|
177 | <xsl:when test="$count>count($funcsynopses)"></xsl:when>
|
---|
178 | <xsl:otherwise>
|
---|
179 | <xsl:variable name="cmdsyn" select="$funcsynopses[$count]"/>
|
---|
180 |
|
---|
181 | <dt>
|
---|
182 | <a>
|
---|
183 | <xsl:attribute name="href">
|
---|
184 | <xsl:call-template name="label.id">
|
---|
185 | <xsl:with-param name="object" select="$cmdsyn"/>
|
---|
186 | </xsl:call-template>
|
---|
187 | </xsl:attribute>
|
---|
188 |
|
---|
189 | <xsl:choose>
|
---|
190 | <xsl:when test="$cmdsyn/@xreflabel">
|
---|
191 | <xsl:call-template name="xref.xreflabel">
|
---|
192 | <xsl:with-param name="target" select="$cmdsyn"/>
|
---|
193 | </xsl:call-template>
|
---|
194 | </xsl:when>
|
---|
195 | <xsl:otherwise>
|
---|
196 | <!-- RCAS Fixme
|
---|
197 | <xsl:call-template name="xref.funcsynopsis">
|
---|
198 | <xsl:with-param name="target" select="$cmdsyn"/>
|
---|
199 | </xsl:call-template>
|
---|
200 | -->
|
---|
201 | </xsl:otherwise>
|
---|
202 | </xsl:choose>
|
---|
203 | </a>
|
---|
204 | </dt>
|
---|
205 |
|
---|
206 | <xsl:call-template name="process.funcsynopsis.list">
|
---|
207 | <xsl:with-param name="funcsynopses" select="$funcsynopses"/>
|
---|
208 | <xsl:with-param name="count" select="$count+1"/>
|
---|
209 | </xsl:call-template>
|
---|
210 | </xsl:otherwise>
|
---|
211 | </xsl:choose>
|
---|
212 | </xsl:template>
|
---|
213 |
|
---|
214 | <xsl:template match="processing-instruction('dbfunclist')">
|
---|
215 | <xsl:variable name="funcsynopses" select="..//funcsynopsis"/>
|
---|
216 |
|
---|
217 | <xsl:if test="count($funcsynopses)<1">
|
---|
218 | <xsl:message><xsl:text>No funcsynopsis elements matched dbfunclist PI, perhaps it's nested too deep?</xsl:text>
|
---|
219 | </xsl:message>
|
---|
220 | </xsl:if>
|
---|
221 |
|
---|
222 | <dl>
|
---|
223 | <xsl:call-template name="process.funcsynopsis.list">
|
---|
224 | <xsl:with-param name="funcsynopses" select="$funcsynopses"/>
|
---|
225 | </xsl:call-template>
|
---|
226 | </dl>
|
---|
227 | </xsl:template>
|
---|
228 |
|
---|
229 | <!-- ==================================================================== -->
|
---|
230 |
|
---|
231 | </xsl:stylesheet>
|
---|