summaryrefslogtreecommitdiff
path: root/slides/schema/relaxng/toc.rng
blob: 4394b0f2b195c9f7c7f159b6fbf8daa9271a1eb3 (plain)
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  This file is part of DocBook V5.0
  
  Copyright 1992-2008 HaL Computer Systems, Inc.,
  O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
  Corporation, Norman Walsh, Sun Microsystems, Inc., and the
  Organization for the Advancement of Structured Information
  Standards (OASIS).
  
  Release: $Id: toc.rnc 8931 2010-10-20 13:29:20Z nwalsh $
  
  Permission to use, copy, modify and distribute the DocBook schema
  and its accompanying documentation for any purpose and without fee
  is hereby granted in perpetuity, provided that the above copyright
  notice and this paragraph appear in all copies. The copyright
  holders make no representation about the suitability of the schema
  for any purpose. It is provided "as is" without expressed or implied
  warranty.
  
  If you modify the DocBook schema in any way, label your schema as a
  variant of DocBook. See the reference documentation
  (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
  for more information.
  
  Please direct all questions, bug reports, or suggestions for changes
  to the docbook@lists.oasis-open.org mailing list. For more
  information, see http://www.oasis-open.org/docbook/.
  
  ======================================================================
-->
<grammar ns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook" xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
  <start combine="choice">
    <choice>
      <ref name="db.toc"/>
      <ref name="db.tocdiv"/>
    </choice>
  </start>
  <define name="db.navigation.components" combine="choice">
    <ref name="db.toc"/>
  </define>
  <define name="db.toc.components" combine="choice">
    <ref name="db.toc"/>
  </define>
  <define name="db.toc.pagenum.attribute">
    <attribute name="pagenum">
      <db:refpurpose>Indicates the page on which this element occurs in some version of the printed document</db:refpurpose>
    </attribute>
  </define>
  <!-- ====================================================================== -->
  <div>
    <db:refname>toc</db:refname>
    <db:refpurpose>A table of contents</db:refpurpose>
    <define name="db.toc.role.attribute">
      <attribute name="role"/>
    </define>
    <define name="db.toc.attlist">
      <interleave>
        <optional>
          <ref name="db.toc.role.attribute"/>
        </optional>
        <ref name="db.common.attributes"/>
        <ref name="db.common.linking.attributes"/>
      </interleave>
    </define>
    <define name="db.toc.info">
      <ref name="db._info.title.only"/>
    </define>
    <define name="db.toc">
      <element name="toc">
        <ref name="db.toc.attlist"/>
        <ref name="db.toc.info"/>
        <zeroOrMore>
          <ref name="db.all.blocks"/>
        </zeroOrMore>
        <zeroOrMore>
          <choice>
            <ref name="db.tocdiv"/>
            <ref name="db.tocentry"/>
          </choice>
        </zeroOrMore>
      </element>
    </define>
  </div>
  <!-- ====================================================================== -->
  <div>
    <db:refname>tocdiv</db:refname>
    <db:refpurpose>A division in a table of contents</db:refpurpose>
    <define name="db.tocdiv.role.attribute">
      <attribute name="role"/>
    </define>
    <define name="db.tocdiv.pagenum.attribute">
      <ref name="db.toc.pagenum.attribute"/>
    </define>
    <define name="db.tocdiv.attlist">
      <interleave>
        <optional>
          <ref name="db.tocdiv.role.attribute"/>
        </optional>
        <ref name="db.common.attributes"/>
        <optional>
          <ref name="db.tocdiv.pagenum.attribute"/>
        </optional>
        <optional>
          <ref name="db.linkend.attribute"/>
        </optional>
      </interleave>
    </define>
    <define name="db.tocdiv.info">
      <ref name="db._info"/>
    </define>
    <define name="db.tocdiv">
      <element name="tocdiv">
        <ref name="db.tocdiv.attlist"/>
        <ref name="db.tocdiv.info"/>
        <zeroOrMore>
          <ref name="db.all.blocks"/>
        </zeroOrMore>
        <oneOrMore>
          <choice>
            <ref name="db.tocdiv"/>
            <ref name="db.tocentry"/>
          </choice>
        </oneOrMore>
      </element>
    </define>
  </div>
  <!-- ====================================================================== -->
  <div>
    <db:refname>tocentry</db:refname>
    <db:refpurpose>A component title in a table of contents</db:refpurpose>
    <define name="db.tocentry.role.attribute">
      <attribute name="role"/>
    </define>
    <define name="db.tocentry.pagenum.attribute">
      <ref name="db.toc.pagenum.attribute"/>
    </define>
    <define name="db.tocentry.attlist">
      <interleave>
        <optional>
          <ref name="db.tocentry.role.attribute"/>
        </optional>
        <ref name="db.common.attributes"/>
        <optional>
          <ref name="db.tocentry.pagenum.attribute"/>
        </optional>
        <optional>
          <ref name="db.linkend.attribute"/>
        </optional>
      </interleave>
    </define>
    <define name="db.tocentry">
      <element name="tocentry">
        <ref name="db.tocentry.attlist"/>
        <zeroOrMore>
          <ref name="db.all.inlines"/>
        </zeroOrMore>
      </element>
    </define>
  </div>
</grammar>