Comment.
[emacs.git] / etc / schema / dbdyntbl.rnc
blob4ade70bbe2e1256b02cdc3fb883bc709cf968a6c
1 # This is an alternative to dbsoextbl.rnc and dbcalstbl.rnc that
2 # allows the table model to be selected dynamically based on the
3 # definitions of cals.table.module and exchange.table.module.
5 # To use this, copy docbook.rnc to docbook-dyntbl.rnc replacing
6 # "dbcalstbl.rnc" by "dbdyntbl.rnc".  Then, you can override the
7 # choice of table model by doing
9 # include "docbook-dyntbl.rnc" {
10 #   cals.table.model = IGNORE
11 #   exchange.table.model = INCLUDE
12 # }
14 INCLUDE = empty
15 IGNORE = notAllowed
16 cals.table.module = INCLUDE
17 exchange.table.module = IGNORE
19 # Add common attributes and the Label attribute to Table and
20 # InformalTable.
21 bodyatt = common.attrib, label.attrib, tables.role.attrib
23 # Content model for Table.
24 tbl.table.mdl =
25   blockinfo?,
26   formalobject.title.content,
27   ndxterm.class*,
28   textobject*,
29   (graphic+ | mediaobject+ | tgroup+)
31 table = cals.table | exchange.table
33 cals.table =
34   cals.table.module,
35   grammar {
36     # Reference CALS Table Model
37     include "calstbl.rnc" {
38       # Add label and role attributes to table and informaltable
39       bodyatt = parent label.attrib
40       # Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
41       # EntryTbl, and Entry (and InformalTable element).
42       secur = parent common.attrib, parent tables.role.attrib
43       tbl.table.mdl = parent tbl.table.mdl
44     }
45   }
47 exchange.table =
48   exchange.table.module,
49   grammar {
50     # Reference OASIS Exchange Table Model
51     include "soextbl.rnc" {
52       # Add common attributes and the Label attribute to Table and
53       # InformalTable.
54       bodyatt = parent bodyatt
55       tbl.table.mdl = parent tbl.table.mdl
56     }
57   }
59 tgroup = cals.tgroup | exchange.tgroup
61 cals.tgroup =
62   cals.table.module,
63   grammar {
64     # Reference CALS Table Model
65     include "calstbl.rnc" {
66       start = tgroup
67       # Add label and role attributes to table and informaltable
68       bodyatt = parent label.attrib
69       # Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
70       # EntryTbl, and Entry (and InformalTable element).
71       secur = parent common.attrib, parent tables.role.attrib
72       # Allow either objects or inlines; beware of REs between elements.
73       tbl.entry.mdl = parent para.char.mix | parent tabentry.mix
74     }
75   }
77 exchange.tgroup =
78   exchange.table.module,
79   grammar {
80     # Reference OASIS Exchange Table Model
81     include "soextbl.rnc" {
82       start = tgroup
83       bodyatt = parent bodyatt
84       # Add common attributes to TGroup, ColSpec, TBody, THead, Row, Entry
85       tbl.tgroup.att = parent common.attrib
86       tbl.colspec.att = parent common.attrib
87       tbl.tbody.att = parent common.attrib
88       tbl.thead.att = parent common.attrib
89       tbl.row.att = parent common.attrib
90       tbl.entry.att = parent common.attrib
91       # Allow either objects or inlines; beware of REs between elements.
92       tbl.entry.mdl = (parent para.char.mix | parent tabentry.mix)*
93     }
94   }
96 tbl.table.att = cals.tbl.table.att | exchange.tbl.table.att
98 cals.tbl.table.att =
99   cals.table.module,
100   grammar {
101     include "calstbl.rnc" {
102       start = tbl.table.att
103     }
104   }
106 exchange.tbl.table.att =
107   exchange.table.module,
108   grammar {
109     include "soextbl.rnc" {
110       start = tbl.table.att
111     }
112   }
114 common.table.attribs = bodyatt
116 # end of table.module