docbook_xsl_wrapper 0.1.2 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/CHANGELOG +41 -0
  4. data/README.md +9 -17
  5. data/bin/docbook_xsl_wrapper +9 -14
  6. data/docbook_xsl_wrapper.gemspec +8 -7
  7. data/lib/docbook_xsl_wrapper.rb +24 -1
  8. data/lib/docbook_xsl_wrapper/epub.rb +124 -122
  9. data/lib/docbook_xsl_wrapper/options.rb +1 -1
  10. data/lib/docbook_xsl_wrapper/validate.rb +22 -0
  11. data/lib/docbook_xsl_wrapper/version.rb +1 -1
  12. data/schema/docbookxi.rng +18654 -0
  13. data/spec/docbook_xsl_wrapper/validate_spec.rb +64 -0
  14. data/xsl/AUTHORS +4 -0
  15. data/xsl/COPYING +48 -0
  16. data/xsl/REVISION +1 -0
  17. data/xsl/VERSION.xsl +115 -0
  18. data/xsl/common/addns.xsl +124 -0
  19. data/xsl/common/af.xml +1272 -0
  20. data/xsl/common/am.xml +1272 -0
  21. data/xsl/common/ar.xml +1272 -0
  22. data/xsl/common/as.xml +703 -0
  23. data/xsl/common/ast.xml +703 -0
  24. data/xsl/common/autoidx-kimber.xsl +45 -0
  25. data/xsl/common/autoidx-kosek.xsl +155 -0
  26. data/xsl/common/az.xml +715 -0
  27. data/xsl/common/bg.xml +767 -0
  28. data/xsl/common/bn.xml +1272 -0
  29. data/xsl/common/bn_in.xml +703 -0
  30. data/xsl/common/bs.xml +705 -0
  31. data/xsl/common/ca.xml +703 -0
  32. data/xsl/common/charmap.xsl +222 -0
  33. data/xsl/common/common.xsl +2129 -0
  34. data/xsl/common/cs.xml +743 -0
  35. data/xsl/common/cy.xml +1288 -0
  36. data/xsl/common/da.xml +707 -0
  37. data/xsl/common/de.xml +709 -0
  38. data/xsl/common/el.xml +772 -0
  39. data/xsl/common/en.xml +1272 -0
  40. data/xsl/common/entities.ent +67 -0
  41. data/xsl/common/eo.xml +1272 -0
  42. data/xsl/common/es.xml +719 -0
  43. data/xsl/common/et.xml +1272 -0
  44. data/xsl/common/eu.xml +1272 -0
  45. data/xsl/common/fa.xml +703 -0
  46. data/xsl/common/fi.xml +713 -0
  47. data/xsl/common/fr.xml +733 -0
  48. data/xsl/common/ga.xml +1272 -0
  49. data/xsl/common/gentext.xsl +855 -0
  50. data/xsl/common/gl.xml +1272 -0
  51. data/xsl/common/gu.xml +703 -0
  52. data/xsl/common/he.xml +1272 -0
  53. data/xsl/common/hi.xml +703 -0
  54. data/xsl/common/hr.xml +705 -0
  55. data/xsl/common/hu.xml +721 -0
  56. data/xsl/common/id.xml +1272 -0
  57. data/xsl/common/insertfile.xsl +113 -0
  58. data/xsl/common/is.xml +715 -0
  59. data/xsl/common/it.xml +1272 -0
  60. data/xsl/common/ja.xml +703 -0
  61. data/xsl/common/ka.xml +743 -0
  62. data/xsl/common/kn.xml +1272 -0
  63. data/xsl/common/ko.xml +1272 -0
  64. data/xsl/common/ky.xml +775 -0
  65. data/xsl/common/l10n.dtd +64 -0
  66. data/xsl/common/l10n.xml +78 -0
  67. data/xsl/common/l10n.xsl +598 -0
  68. data/xsl/common/la.xml +1272 -0
  69. data/xsl/common/labels.xsl +933 -0
  70. data/xsl/common/lt.xml +721 -0
  71. data/xsl/common/lv.xml +1272 -0
  72. data/xsl/common/ml.xml +703 -0
  73. data/xsl/common/mn.xml +773 -0
  74. data/xsl/common/mr.xml +703 -0
  75. data/xsl/common/nb.xml +1272 -0
  76. data/xsl/common/nds.xml +709 -0
  77. data/xsl/common/nl.xml +703 -0
  78. data/xsl/common/nn.xml +1272 -0
  79. data/xsl/common/olink.xsl +1284 -0
  80. data/xsl/common/or.xml +1272 -0
  81. data/xsl/common/pa.xml +703 -0
  82. data/xsl/common/pi.xml +168 -0
  83. data/xsl/common/pi.xsl +347 -0
  84. data/xsl/common/pl.xml +721 -0
  85. data/xsl/common/pt.xml +1272 -0
  86. data/xsl/common/pt_br.xml +1272 -0
  87. data/xsl/common/refentry.xsl +1353 -0
  88. data/xsl/common/ro.xml +1272 -0
  89. data/xsl/common/ru.xml +769 -0
  90. data/xsl/common/sk.xml +1272 -0
  91. data/xsl/common/sl.xml +1272 -0
  92. data/xsl/common/sq.xml +1272 -0
  93. data/xsl/common/sr.xml +763 -0
  94. data/xsl/common/sr_Latn.xml +722 -0
  95. data/xsl/common/subtitles.xsl +181 -0
  96. data/xsl/common/sv.xml +707 -0
  97. data/xsl/common/ta.xml +703 -0
  98. data/xsl/common/table.xsl +515 -0
  99. data/xsl/common/targetdatabase.dtd +49 -0
  100. data/xsl/common/targets.xsl +338 -0
  101. data/xsl/common/te.xml +703 -0
  102. data/xsl/common/th.xml +1272 -0
  103. data/xsl/common/titles.xsl +850 -0
  104. data/xsl/common/tl.xml +1272 -0
  105. data/xsl/common/tr.xml +709 -0
  106. data/xsl/common/uk.xml +769 -0
  107. data/xsl/common/ur.xml +705 -0
  108. data/xsl/common/utility.xsl +291 -0
  109. data/xsl/common/vi.xml +1272 -0
  110. data/xsl/common/xh.xml +1272 -0
  111. data/xsl/common/zh.xml +703 -0
  112. data/xsl/common/zh_cn.xml +703 -0
  113. data/xsl/common/zh_tw.xml +703 -0
  114. data/xsl/epub/docbook.xsl +1769 -0
  115. data/xsl/epub3/chunk.xsl +30 -0
  116. data/xsl/epub3/docbook-epub.css.xml +142 -0
  117. data/xsl/epub3/docbook.xsl +20 -0
  118. data/xsl/epub3/epub3-chunk-mods.xsl +52 -0
  119. data/xsl/epub3/epub3-element-mods.xsl +2533 -0
  120. data/xsl/epub3/titlepage.templates.xml +712 -0
  121. data/xsl/epub3/titlepage.templates.xsl +3842 -0
  122. data/xsl/lib/lib.xsl +533 -0
  123. data/xsl/xhtml/admon.xsl +142 -0
  124. data/xsl/xhtml/annotations.xsl +160 -0
  125. data/xsl/xhtml/autoidx.xsl +831 -0
  126. data/xsl/xhtml/autotoc.xsl +706 -0
  127. data/xsl/xhtml/biblio-iso690.xsl +1302 -0
  128. data/xsl/xhtml/biblio.xsl +1371 -0
  129. data/xsl/xhtml/block.xsl +584 -0
  130. data/xsl/xhtml/callout.xsl +210 -0
  131. data/xsl/xhtml/chunk-code.xsl +675 -0
  132. data/xsl/xhtml/chunk-common.xsl +1627 -0
  133. data/xsl/xhtml/chunker.xsl +317 -0
  134. data/xsl/xhtml/component.xsl +440 -0
  135. data/xsl/xhtml/division.xsl +214 -0
  136. data/xsl/xhtml/ebnf.xsl +331 -0
  137. data/xsl/xhtml/footnote.xsl +346 -0
  138. data/xsl/xhtml/formal.xsl +496 -0
  139. data/xsl/xhtml/glossary.xsl +602 -0
  140. data/xsl/xhtml/graphics.xsl +1537 -0
  141. data/xsl/xhtml/html-rtf.xsl +321 -0
  142. data/xsl/xhtml/html.xsl +690 -0
  143. data/xsl/xhtml/htmltbl.xsl +102 -0
  144. data/xsl/xhtml/index.xsl +264 -0
  145. data/xsl/xhtml/info.xsl +48 -0
  146. data/xsl/xhtml/inline.xsl +1508 -0
  147. data/xsl/xhtml/its.xsl +109 -0
  148. data/xsl/xhtml/keywords.xsl +38 -0
  149. data/xsl/xhtml/lists.xsl +1227 -0
  150. data/xsl/xhtml/math.xsl +286 -0
  151. data/xsl/xhtml/param.xsl +449 -0
  152. data/xsl/xhtml/pi.xsl +1237 -0
  153. data/xsl/xhtml/qandaset.xsl +440 -0
  154. data/xsl/xhtml/refentry.xsl +307 -0
  155. data/xsl/xhtml/sections.xsl +564 -0
  156. data/xsl/xhtml/synop.xsl +1623 -0
  157. data/xsl/xhtml/table.xsl +1179 -0
  158. data/xsl/xhtml/task.xsl +76 -0
  159. data/xsl/xhtml/titlepage.templates.xsl +4005 -0
  160. data/xsl/xhtml/titlepage.xsl +1108 -0
  161. data/xsl/xhtml/toc.xsl +334 -0
  162. data/xsl/xhtml/verbatim.xsl +389 -0
  163. data/xsl/xhtml/xref.xsl +1268 -0
  164. data/xsl/xhtml5/docbook.xsl +22 -0
  165. data/xsl/xhtml5/html5-chunk-mods.xsl +112 -0
  166. data/xsl/xhtml5/html5-element-mods.xsl +791 -0
  167. data/xsl/xhtml5/xhtml-docbook.xsl +531 -0
  168. metadata +207 -27
  169. data/.rvmrc +0 -48
  170. data/xslt/obfuscate.xsl +0 -12
@@ -0,0 +1,214 @@
1
+ <?xml version="1.0" encoding="ASCII"?>
2
+ <!--This file was created automatically by html2xhtml-->
3
+ <!--from the HTML stylesheets.-->
4
+ <xsl:stylesheet exclude-result-prefixes="d"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook"
6
+ xmlns="http://www.w3.org/1999/xhtml" version="1.0">
7
+
8
+ <!-- ********************************************************************
9
+ $Id: division.xsl 9366 2012-05-12 23:44:25Z bobstayton $
10
+ ********************************************************************
11
+
12
+ This file is part of the XSL DocBook Stylesheet distribution.
13
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
14
+ copyright and other information.
15
+
16
+ ******************************************************************** -->
17
+
18
+ <!-- ==================================================================== -->
19
+
20
+ <xsl:template match="d:set">
21
+ <xsl:call-template name="id.warning"/>
22
+
23
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
24
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
25
+ <xsl:call-template name="id.attribute">
26
+ <xsl:with-param name="conditional" select="0"/>
27
+ </xsl:call-template>
28
+ <xsl:call-template name="dir">
29
+ <xsl:with-param name="inherit" select="1"/>
30
+ </xsl:call-template>
31
+ <xsl:call-template name="language.attribute"/>
32
+ <xsl:if test="$generate.id.attributes != 0">
33
+ <xsl:attribute name="id">
34
+ <xsl:call-template name="object.id"/>
35
+ </xsl:attribute>
36
+ </xsl:if>
37
+
38
+ <xsl:call-template name="set.titlepage"/>
39
+
40
+ <xsl:variable name="toc.params">
41
+ <xsl:call-template name="find.path.params">
42
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
43
+ </xsl:call-template>
44
+ </xsl:variable>
45
+
46
+ <xsl:call-template name="make.lots">
47
+ <xsl:with-param name="toc.params" select="$toc.params"/>
48
+ <xsl:with-param name="toc">
49
+ <xsl:call-template name="set.toc">
50
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
51
+ </xsl:call-template>
52
+ </xsl:with-param>
53
+ </xsl:call-template>
54
+
55
+ <xsl:apply-templates/>
56
+ </xsl:element>
57
+ </xsl:template>
58
+
59
+ <xsl:template match="d:set/d:setinfo"/>
60
+ <xsl:template match="d:set/d:title"/>
61
+ <xsl:template match="d:set/d:titleabbrev"/>
62
+ <xsl:template match="d:set/d:subtitle"/>
63
+
64
+ <!-- ==================================================================== -->
65
+
66
+ <xsl:template match="d:book">
67
+ <xsl:call-template name="id.warning"/>
68
+
69
+ <div>
70
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
71
+ <xsl:call-template name="id.attribute">
72
+ <xsl:with-param name="conditional" select="0"/>
73
+ </xsl:call-template>
74
+
75
+ <xsl:call-template name="book.titlepage"/>
76
+
77
+ <xsl:apply-templates select="d:dedication" mode="dedication"/>
78
+ <xsl:apply-templates select="d:acknowledgements" mode="acknowledgements"/>
79
+
80
+ <xsl:variable name="toc.params">
81
+ <xsl:call-template name="find.path.params">
82
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
83
+ </xsl:call-template>
84
+ </xsl:variable>
85
+
86
+ <xsl:call-template name="make.lots">
87
+ <xsl:with-param name="toc.params" select="$toc.params"/>
88
+ <xsl:with-param name="toc">
89
+ <xsl:call-template name="division.toc">
90
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
91
+ </xsl:call-template>
92
+ </xsl:with-param>
93
+ </xsl:call-template>
94
+
95
+ <xsl:apply-templates/>
96
+ </div>
97
+ </xsl:template>
98
+
99
+ <xsl:template match="d:book/d:bookinfo"/>
100
+ <xsl:template match="d:book/d:info"/>
101
+ <xsl:template match="d:book/d:title"/>
102
+ <xsl:template match="d:book/d:titleabbrev"/>
103
+ <xsl:template match="d:book/d:subtitle"/>
104
+
105
+ <!-- ==================================================================== -->
106
+
107
+ <xsl:template match="d:part">
108
+ <xsl:call-template name="id.warning"/>
109
+
110
+ <div>
111
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
112
+ <xsl:call-template name="id.attribute">
113
+ <xsl:with-param name="conditional" select="0"/>
114
+ </xsl:call-template>
115
+
116
+ <xsl:call-template name="part.titlepage"/>
117
+
118
+ <xsl:variable name="toc.params">
119
+ <xsl:call-template name="find.path.params">
120
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
121
+ </xsl:call-template>
122
+ </xsl:variable>
123
+ <xsl:if test="not(d:partintro) and contains($toc.params, 'toc')">
124
+ <xsl:call-template name="division.toc"/>
125
+ </xsl:if>
126
+ <xsl:apply-templates/>
127
+ </div>
128
+ </xsl:template>
129
+
130
+ <xsl:template match="d:part" mode="make.part.toc">
131
+ <xsl:call-template name="division.toc"/>
132
+ </xsl:template>
133
+
134
+ <xsl:template match="d:reference" mode="make.part.toc">
135
+ <xsl:call-template name="division.toc"/>
136
+ </xsl:template>
137
+
138
+ <xsl:template match="d:part/d:docinfo"/>
139
+ <xsl:template match="d:part/d:partinfo"/>
140
+ <xsl:template match="d:part/d:info"/>
141
+ <xsl:template match="d:part/d:title"/>
142
+ <xsl:template match="d:part/d:titleabbrev"/>
143
+ <xsl:template match="d:part/d:subtitle"/>
144
+
145
+ <xsl:template match="d:partintro">
146
+ <xsl:call-template name="id.warning"/>
147
+
148
+ <div>
149
+ <xsl:call-template name="common.html.attributes"/>
150
+ <xsl:call-template name="id.attribute">
151
+ <xsl:with-param name="conditional" select="0"/>
152
+ </xsl:call-template>
153
+
154
+ <xsl:call-template name="partintro.titlepage"/>
155
+ <xsl:apply-templates/>
156
+
157
+ <xsl:variable name="toc.params">
158
+ <xsl:call-template name="find.path.params">
159
+ <xsl:with-param name="node" select="parent::*"/>
160
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
161
+ </xsl:call-template>
162
+ </xsl:variable>
163
+ <xsl:if test="contains($toc.params, 'toc')">
164
+ <!-- not ancestor::part because partintro appears in reference -->
165
+ <xsl:apply-templates select="parent::*" mode="make.part.toc"/>
166
+ </xsl:if>
167
+ <xsl:call-template name="process.footnotes"/>
168
+ </div>
169
+ </xsl:template>
170
+
171
+ <xsl:template match="d:partintro/d:title"/>
172
+ <xsl:template match="d:partintro/d:titleabbrev"/>
173
+ <xsl:template match="d:partintro/d:subtitle"/>
174
+
175
+ <xsl:template match="d:partintro/d:title" mode="partintro.title.mode">
176
+ <h2>
177
+ <xsl:apply-templates/>
178
+ </h2>
179
+ </xsl:template>
180
+
181
+ <xsl:template match="d:partintro/d:subtitle" mode="partintro.title.mode">
182
+ <h3>
183
+ <em xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates/></em>
184
+ </h3>
185
+ </xsl:template>
186
+
187
+ <!-- ==================================================================== -->
188
+
189
+ <xsl:template match="d:book" mode="division.number">
190
+ <xsl:number from="d:set" count="d:book" format="1."/>
191
+ </xsl:template>
192
+
193
+ <xsl:template match="d:part" mode="division.number">
194
+ <xsl:number from="d:book" count="d:part" format="I."/>
195
+ </xsl:template>
196
+
197
+ <!-- ==================================================================== -->
198
+
199
+ <xsl:template name="division.title">
200
+ <xsl:param name="node" select="."/>
201
+
202
+ <h1>
203
+ <xsl:attribute name="class">title</xsl:attribute>
204
+ <xsl:call-template name="anchor">
205
+ <xsl:with-param name="node" select="$node"/>
206
+ <xsl:with-param name="conditional" select="0"/>
207
+ </xsl:call-template>
208
+ <xsl:apply-templates select="$node" mode="object.title.markup">
209
+ <xsl:with-param name="allow-anchors" select="1"/>
210
+ </xsl:apply-templates>
211
+ </h1>
212
+ </xsl:template>
213
+
214
+ </xsl:stylesheet>
@@ -0,0 +1,331 @@
1
+ <?xml version="1.0" encoding="ASCII"?>
2
+ <!--This file was created automatically by html2xhtml-->
3
+ <!--from the HTML stylesheets.-->
4
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook"
5
+ xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="doc d" version="1.0">
6
+
7
+ <!-- ********************************************************************
8
+ $Id: ebnf.xsl 9664 2012-11-07 20:02:17Z bobstayton $
9
+ ********************************************************************
10
+
11
+ This file is part of the XSL DocBook Stylesheet distribution.
12
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
13
+ copyright and other information.
14
+
15
+ ******************************************************************** -->
16
+
17
+ <doc:reference xmlns="">
18
+ <referenceinfo xmlns="http://www.w3.org/1999/xhtml">
19
+ <releaseinfo role="meta">
20
+ $Id: ebnf.xsl 9664 2012-11-07 20:02:17Z bobstayton $
21
+ </releaseinfo>
22
+ <author><surname>Walsh</surname>
23
+ <firstname>Norman</firstname></author>
24
+ <copyright><year>1999</year><year>2000</year>
25
+ <holder>Norman Walsh</holder>
26
+ </copyright>
27
+ </referenceinfo>
28
+ <title xmlns="http://www.w3.org/1999/xhtml">HTML EBNF Reference</title>
29
+
30
+ <partintro xmlns="http://www.w3.org/1999/xhtml">
31
+ <section><title>Introduction</title>
32
+
33
+ <para>This is technical reference documentation for the DocBook XSL
34
+ Stylesheets; it documents (some of) the parameters, templates, and
35
+ other elements of the stylesheets.</para>
36
+
37
+ <para>This reference describes the templates and parameters relevant
38
+ to formatting EBNF markup.</para>
39
+
40
+ <para>This is not intended to be <quote>user</quote> documentation.
41
+ It is provided for developers writing customization layers for the
42
+ stylesheets, and for anyone who's interested in <quote>how it
43
+ works</quote>.</para>
44
+
45
+ <para>Although I am trying to be thorough, this documentation is known
46
+ to be incomplete. Don't forget to read the source, too :-)</para>
47
+ </section>
48
+ </partintro>
49
+ </doc:reference>
50
+
51
+ <!-- ==================================================================== -->
52
+
53
+ <xsl:template match="d:productionset">
54
+ <table width="100%" cellpadding="5">
55
+ <xsl:if test="$ebnf.table.bgcolor != ''">
56
+ <xsl:attribute name="bgcolor">
57
+ <xsl:value-of select="$ebnf.table.bgcolor"/>
58
+ </xsl:attribute>
59
+ </xsl:if>
60
+ <xsl:if test="$ebnf.table.border != 0">
61
+ <xsl:attribute name="border">1</xsl:attribute>
62
+ </xsl:if>
63
+ <xsl:attribute name="class">
64
+ <xsl:value-of select="local-name(.)"/>
65
+ </xsl:attribute>
66
+ <xsl:attribute name="summary">
67
+ <xsl:text>EBNF</xsl:text>
68
+ <xsl:if test="d:title|d:info/d:title">
69
+ <xsl:text> for </xsl:text>
70
+ <xsl:value-of select="d:title|d:info/d:title[1]"/>
71
+ </xsl:if>
72
+ </xsl:attribute>
73
+
74
+ <xsl:if test="d:title|d:info/d:title">
75
+ <tr>
76
+ <th align="{$direction.align.start}" valign="top">
77
+ <xsl:apply-templates select="." mode="class.attribute"/>
78
+ <xsl:apply-templates select="d:title|d:info/d:title[1]"/>
79
+ </th>
80
+ </tr>
81
+ </xsl:if>
82
+ <tr>
83
+ <td>
84
+ <table border="0" width="99%" cellpadding="0">
85
+ <xsl:if test="$ebnf.table.bgcolor != ''">
86
+ <xsl:attribute name="bgcolor">
87
+ <xsl:value-of select="$ebnf.table.bgcolor"/>
88
+ </xsl:attribute>
89
+ </xsl:if>
90
+ <xsl:attribute name="class">
91
+ <xsl:value-of select="local-name(.)"/>
92
+ </xsl:attribute>
93
+ <xsl:attribute name="summary">EBNF productions</xsl:attribute>
94
+ <xsl:apply-templates select="d:production|d:productionrecap"/>
95
+ </table>
96
+ </td>
97
+ </tr>
98
+ </table>
99
+ </xsl:template>
100
+
101
+ <xsl:template match="d:productionset/d:title">
102
+ <xsl:apply-templates/>
103
+ </xsl:template>
104
+
105
+ <xsl:template match="d:production">
106
+ <xsl:param name="recap" select="false()"/>
107
+ <tr>
108
+ <td align="{$direction.align.start}" valign="top" width="3%">
109
+ <xsl:text>[</xsl:text>
110
+ <xsl:apply-templates select="." mode="label.markup"/>
111
+ <xsl:text>]</xsl:text>
112
+ </td>
113
+ <td align="{$direction.align.end}" valign="top" width="10%">
114
+ <xsl:choose>
115
+ <xsl:when test="$recap">
116
+ <a>
117
+ <xsl:attribute name="href">
118
+ <xsl:call-template name="href.target">
119
+ <xsl:with-param name="object" select="."/>
120
+ </xsl:call-template>
121
+ </xsl:attribute>
122
+ <xsl:apply-templates select="d:lhs"/>
123
+ </a>
124
+ </xsl:when>
125
+ <xsl:otherwise>
126
+ <xsl:call-template name="id.attribute"/>
127
+ <xsl:call-template name="anchor"/>
128
+ <xsl:apply-templates select="d:lhs"/>
129
+ </xsl:otherwise>
130
+ </xsl:choose>
131
+ </td>
132
+ <td valign="top" width="5%" align="center">
133
+ <xsl:copy-of select="$ebnf.assignment"/>
134
+ </td>
135
+ <td valign="top" width="52%">
136
+ <xsl:apply-templates select="d:rhs"/>
137
+ <xsl:copy-of select="$ebnf.statement.terminator"/>
138
+ </td>
139
+ <td align="{$direction.align.start}" valign="top" width="30%">
140
+ <xsl:choose>
141
+ <xsl:when test="d:rhs/d:lineannotation|d:constraint">
142
+ <xsl:apply-templates select="d:rhs/d:lineannotation" mode="rhslo"/>
143
+ <xsl:apply-templates select="d:constraint"/>
144
+ </xsl:when>
145
+ <xsl:otherwise>
146
+ <xsl:text>&#160;</xsl:text>
147
+ </xsl:otherwise>
148
+ </xsl:choose>
149
+ </td>
150
+ </tr>
151
+ </xsl:template>
152
+
153
+ <xsl:template match="d:productionrecap">
154
+ <xsl:variable name="targets" select="key('id',@linkend)"/>
155
+ <xsl:variable name="target" select="$targets[1]"/>
156
+
157
+ <xsl:if test="count($targets)=0">
158
+ <xsl:message>
159
+ <xsl:text>Error: no ID for productionrecap linkend: </xsl:text>
160
+ <xsl:value-of select="@linkend"/>
161
+ <xsl:text>.</xsl:text>
162
+ </xsl:message>
163
+ </xsl:if>
164
+
165
+ <xsl:if test="count($targets)&gt;1">
166
+ <xsl:message>
167
+ <xsl:text>Warning: multiple "IDs" for productionrecap linkend: </xsl:text>
168
+ <xsl:value-of select="@linkend"/>
169
+ <xsl:text>.</xsl:text>
170
+ </xsl:message>
171
+ </xsl:if>
172
+
173
+ <xsl:apply-templates select="$target">
174
+ <xsl:with-param name="recap" select="true()"/>
175
+ </xsl:apply-templates>
176
+ </xsl:template>
177
+
178
+ <xsl:template match="d:lhs">
179
+ <xsl:apply-templates/>
180
+ </xsl:template>
181
+
182
+ <xsl:template match="d:rhs">
183
+ <xsl:apply-templates/>
184
+ <xsl:if test="following-sibling::d:rhs">
185
+ <xsl:text> |</xsl:text>
186
+ <br/>
187
+ </xsl:if>
188
+ </xsl:template>
189
+
190
+ <xsl:template match="d:nonterminal">
191
+ <xsl:variable name="linkend">
192
+ <xsl:call-template name="xpointer.idref">
193
+ <xsl:with-param name="xpointer" select="@def"/>
194
+ </xsl:call-template>
195
+ </xsl:variable>
196
+
197
+ <xsl:call-template name="check.id.unique">
198
+ <xsl:with-param name="linkend" select="$linkend"/>
199
+ </xsl:call-template>
200
+
201
+ <xsl:call-template name="check.idref.targets">
202
+ <xsl:with-param name="linkend" select="$linkend"/>
203
+ <xsl:with-param name="element-list">production</xsl:with-param>
204
+ </xsl:call-template>
205
+
206
+ <!-- If you don't provide content, you can't point outside this doc. -->
207
+ <xsl:choose>
208
+ <xsl:when test="*|text()"><!--nop--></xsl:when>
209
+ <xsl:otherwise>
210
+ <xsl:if test="$linkend = ''">
211
+ <xsl:message>
212
+ <xsl:text>Non-terminals with no content must point to </xsl:text>
213
+ <xsl:text>production elements in the current document.</xsl:text>
214
+ </xsl:message>
215
+ <xsl:message>
216
+ <xsl:text>Invalid xpointer for empty nt: </xsl:text>
217
+ <xsl:value-of select="@def"/>
218
+ </xsl:message>
219
+ </xsl:if>
220
+ </xsl:otherwise>
221
+ </xsl:choose>
222
+
223
+ <xsl:variable name="href">
224
+ <xsl:choose>
225
+ <xsl:when test="$linkend != ''">
226
+ <xsl:variable name="targets" select="key('id',$linkend)"/>
227
+ <xsl:variable name="target" select="$targets[1]"/>
228
+ <xsl:call-template name="href.target">
229
+ <xsl:with-param name="object" select="$target"/>
230
+ </xsl:call-template>
231
+ </xsl:when>
232
+ <xsl:otherwise>
233
+ <xsl:value-of select="@def"/>
234
+ </xsl:otherwise>
235
+ </xsl:choose>
236
+ </xsl:variable>
237
+
238
+ <a href="{$href}">
239
+ <xsl:choose>
240
+ <xsl:when test="*|text()">
241
+ <xsl:apply-templates/>
242
+ </xsl:when>
243
+ <xsl:otherwise>
244
+ <xsl:choose>
245
+ <xsl:when test="$linkend != ''">
246
+ <xsl:variable name="targets" select="key('id',$linkend)"/>
247
+ <xsl:variable name="target" select="$targets[1]"/>
248
+ <xsl:apply-templates select="$target/d:lhs"/>
249
+ </xsl:when>
250
+ <xsl:otherwise>
251
+ <xsl:text>???</xsl:text>
252
+ </xsl:otherwise>
253
+ </xsl:choose>
254
+ </xsl:otherwise>
255
+ </xsl:choose>
256
+ </a>
257
+ </xsl:template>
258
+
259
+ <xsl:template match="d:rhs/d:lineannotation">
260
+ <!--nop-->
261
+ </xsl:template>
262
+
263
+ <xsl:template match="d:rhs/d:lineannotation" mode="rhslo">
264
+ <xsl:text>/*&#160;</xsl:text>
265
+ <xsl:apply-templates/>
266
+ <xsl:text>&#160;*/</xsl:text>
267
+ <br/>
268
+ </xsl:template>
269
+
270
+ <xsl:template match="d:constraint">
271
+ <xsl:call-template name="check.id.unique">
272
+ <xsl:with-param name="linkend" select="@linkend"/>
273
+ </xsl:call-template>
274
+
275
+ <xsl:call-template name="check.idref.targets">
276
+ <xsl:with-param name="linkend" select="@linkend"/>
277
+ <xsl:with-param name="element-list">constraintdef</xsl:with-param>
278
+ </xsl:call-template>
279
+
280
+ <xsl:variable name="href">
281
+ <xsl:variable name="targets" select="key('id',@linkend)"/>
282
+ <xsl:variable name="target" select="$targets[1]"/>
283
+ <xsl:call-template name="href.target">
284
+ <xsl:with-param name="object" select="$target"/>
285
+ </xsl:call-template>
286
+ </xsl:variable>
287
+
288
+ <xsl:text>[&#160;</xsl:text>
289
+
290
+ <xsl:choose>
291
+ <xsl:when test="@role">
292
+ <xsl:value-of select="@role"/>
293
+ <xsl:text>: </xsl:text>
294
+ </xsl:when>
295
+ <xsl:otherwise>
296
+ <xsl:variable name="targets" select="key('id',@linkend)"/>
297
+ <xsl:variable name="target" select="$targets[1]"/>
298
+ <xsl:if test="$target/@role">
299
+ <xsl:value-of select="$target/@role"/>
300
+ <xsl:text>: </xsl:text>
301
+ </xsl:if>
302
+ </xsl:otherwise>
303
+ </xsl:choose>
304
+
305
+ <a href="{$href}">
306
+ <xsl:variable name="targets" select="key('id',@linkend)"/>
307
+ <xsl:variable name="target" select="$targets[1]"/>
308
+ <xsl:apply-templates select="$target" mode="title.markup"/>
309
+ </a>
310
+ <xsl:text>&#160;]</xsl:text>
311
+ <xsl:if test="following-sibling::d:constraint">
312
+ <br/>
313
+ </xsl:if>
314
+ </xsl:template>
315
+
316
+ <xsl:template match="d:constraintdef">
317
+ <div>
318
+ <xsl:apply-templates select="." mode="class.attribute"/>
319
+ <xsl:call-template name="id.attribute"/>
320
+ <xsl:call-template name="anchor"/>
321
+ <xsl:apply-templates/>
322
+ </div>
323
+ </xsl:template>
324
+
325
+ <xsl:template match="d:constraintdef/d:title">
326
+ <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates/></strong></p>
327
+ </xsl:template>
328
+
329
+ <!-- ==================================================================== -->
330
+
331
+ </xsl:stylesheet>