1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="doc" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <doc:reference xmlns="">
17 <referenceinfo xmlns="http://www.w3.org/1999/xhtml">
18 <releaseinfo role="meta">
21 <author><surname>Walsh</surname>
22 <firstname>Norman</firstname></author>
23 <copyright><year>1999</year><year>2000</year>
24 <holder>Norman Walsh</holder>
27 <title xmlns="http://www.w3.org/1999/xhtml">HTML EBNF Reference</title>
29 <partintro xmlns="http://www.w3.org/1999/xhtml">
30 <section><title>Introduction</title>
32 <para>This is technical reference documentation for the DocBook XSL
33 Stylesheets; it documents (some of) the parameters, templates, and
34 other elements of the stylesheets.</para>
36 <para>This reference describes the templates and parameters relevant
37 to formatting EBNF markup.</para>
39 <para>This is not intended to be <quote>user</quote> documentation.
40 It is provided for developers writing customization layers for the
41 stylesheets, and for anyone who's interested in <quote>how it
44 <para>Although I am trying to be thorough, this documentation is known
45 to be incomplete. Don't forget to read the source, too :-)</para>
50 <!-- ==================================================================== -->
52 <xsl:template match="productionset">
53 <table width="100%" cellpadding="5">
54 <xsl:if test="$ebnf.table.bgcolor != ''">
55 <xsl:attribute name="bgcolor">
56 <xsl:value-of select="$ebnf.table.bgcolor"/>
59 <xsl:if test="$ebnf.table.border != 0">
60 <xsl:attribute name="border">1</xsl:attribute>
62 <xsl:attribute name="class">
63 <xsl:value-of select="name(.)"/>
65 <xsl:attribute name="summary">
66 <xsl:text>EBNF</xsl:text>
68 <xsl:text> for </xsl:text>
69 <xsl:value-of select="title"/>
75 <th align="left" valign="top" class="{name(.)}">
76 <xsl:apply-templates select="title"/>
82 <table border="0" width="99%" cellpadding="0">
83 <xsl:if test="$ebnf.table.bgcolor != ''">
84 <xsl:attribute name="bgcolor">
85 <xsl:value-of select="$ebnf.table.bgcolor"/>
88 <xsl:attribute name="class">
89 <xsl:value-of select="name(.)"/>
91 <xsl:attribute name="summary">EBNF productions</xsl:attribute>
92 <xsl:apply-templates select="production|productionrecap"/>
99 <xsl:template match="productionset/title">
100 <xsl:apply-templates/>
103 <xsl:template match="production">
104 <xsl:param name="recap" select="false()"/>
106 <td align="left" valign="top" width="3%">
107 <xsl:text>[</xsl:text>
108 <xsl:number count="production" level="any"/>
109 <xsl:text>]</xsl:text>
111 <td align="right" valign="top" width="10%">
113 <xsl:when test="$recap">
115 <xsl:attribute name="href">
116 <xsl:call-template name="href.target">
117 <xsl:with-param name="object" select="."/>
120 <xsl:apply-templates select="lhs"/>
124 <xsl:call-template name="anchor"/>
125 <xsl:apply-templates select="lhs"/>
129 <td valign="top" width="5%" align="center">
130 <xsl:copy-of select="$ebnf.assignment"/>
132 <td valign="top" width="52%">
133 <xsl:apply-templates select="rhs"/>
134 <xsl:copy-of select="$ebnf.statement.terminator"/>
136 <td align="left" valign="top" width="30%">
138 <xsl:when test="rhs/lineannotation|constraint">
139 <xsl:apply-templates select="rhs/lineannotation" mode="rhslo"/>
140 <xsl:apply-templates select="constraint"/>
143 <xsl:text> </xsl:text>
150 <xsl:template match="productionrecap">
151 <xsl:variable name="targets" select="key('id',@linkend)"/>
152 <xsl:variable name="target" select="$targets[1]"/>
154 <xsl:if test="count($targets)=0">
156 <xsl:text>Error: no ID for productionrecap linkend: </xsl:text>
157 <xsl:value-of select="@linkend"/>
158 <xsl:text>.</xsl:text>
162 <xsl:if test="count($targets)>1">
164 <xsl:text>Warning: multiple "IDs" for productionrecap linkend: </xsl:text>
165 <xsl:value-of select="@linkend"/>
166 <xsl:text>.</xsl:text>
170 <xsl:apply-templates select="$target">
171 <xsl:with-param name="recap" select="true()"/>
172 </xsl:apply-templates>
175 <xsl:template match="lhs">
176 <xsl:apply-templates/>
179 <xsl:template match="rhs">
180 <xsl:apply-templates/>
181 <xsl:if test="following-sibling::rhs">
182 <xsl:text> |</xsl:text>
187 <xsl:template match="nonterminal">
188 <xsl:variable name="linkend">
189 <xsl:call-template name="xpointer.idref">
190 <xsl:with-param name="xpointer" select="@def"/>
194 <xsl:call-template name="check.id.unique">
195 <xsl:with-param name="linkend" select="$linkend"/>
198 <xsl:call-template name="check.idref.targets">
199 <xsl:with-param name="linkend" select="$linkend"/>
200 <xsl:with-param name="element-list">production</xsl:with-param>
203 <!-- If you don't provide content, you can't point outside this doc. -->
205 <xsl:when test="*|text()"><!--nop--></xsl:when>
207 <xsl:if test="$linkend = ''">
209 <xsl:text>Non-terminals with no content must point to </xsl:text>
210 <xsl:text>production elements in the current document.</xsl:text>
213 <xsl:text>Invalid xpointer for empty nt: </xsl:text>
214 <xsl:value-of select="@def"/>
220 <xsl:variable name="href">
222 <xsl:when test="$linkend != ''">
223 <xsl:variable name="targets" select="key('id',$linkend)"/>
224 <xsl:variable name="target" select="$targets[1]"/>
225 <xsl:call-template name="href.target">
226 <xsl:with-param name="object" select="$target"/>
230 <xsl:value-of select="@def"/>
237 <xsl:when test="*|text()">
238 <xsl:apply-templates/>
242 <xsl:when test="$linkend != ''">
243 <xsl:variable name="targets" select="key('id',$linkend)"/>
244 <xsl:variable name="target" select="$targets[1]"/>
245 <xsl:apply-templates select="$target/lhs"/>
248 <xsl:text>???</xsl:text>
256 <xsl:template match="rhs/lineannotation">
260 <xsl:template match="rhs/lineannotation" mode="rhslo">
261 <xsl:text>/* </xsl:text>
262 <xsl:apply-templates/>
263 <xsl:text> */</xsl:text>
267 <xsl:template match="constraint">
268 <xsl:call-template name="check.id.unique">
269 <xsl:with-param name="linkend" select="@linkend"/>
272 <xsl:call-template name="check.idref.targets">
273 <xsl:with-param name="linkend" select="@linkend"/>
274 <xsl:with-param name="element-list">constraintdef</xsl:with-param>
277 <xsl:variable name="href">
278 <xsl:variable name="targets" select="key('id',@linkend)"/>
279 <xsl:variable name="target" select="$targets[1]"/>
280 <xsl:call-template name="href.target">
281 <xsl:with-param name="object" select="$target"/>
285 <xsl:text>[ </xsl:text>
288 <xsl:when test="@role">
289 <xsl:value-of select="@role"/>
290 <xsl:text>: </xsl:text>
293 <xsl:variable name="targets" select="key('id',@linkend)"/>
294 <xsl:variable name="target" select="$targets[1]"/>
295 <xsl:if test="$target/@role">
296 <xsl:value-of select="$target/@role"/>
297 <xsl:text>: </xsl:text>
303 <xsl:variable name="targets" select="key('id',@linkend)"/>
304 <xsl:variable name="target" select="$targets[1]"/>
305 <xsl:apply-templates select="$target" mode="title.markup"/>
307 <xsl:text> ]</xsl:text>
308 <xsl:if test="following-sibling::constraint">
313 <xsl:template match="constraintdef">
314 <div class="{name(.)}">
315 <xsl:call-template name="anchor"/>
316 <xsl:apply-templates/>
320 <xsl:template match="constraintdef/title">
321 <p><b><xsl:apply-templates/></b></p>
324 <!-- ==================================================================== -->