2
* Copyright (C) 2005 Vincent Balat
3
* Laboratoire PPS - CNRS Universit� Paris Diderot
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU Lesser General Public License as published by
7
* the Free Software Foundation, with linking exception;
8
* either version 2.1 of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
(** XHTML types with variants. (See also {!XHTML.M}) *)
20
(* I use these types to constraint typing with the syntax extension *)
22
type tag = [ `Br | `Span | `Bdo | `Map | `Object | `Img | `Tt | `I | `B | `Big
23
| `Small | `Em | `Strong | `Dfn | `Code | `Q | `Samp | `Kbd | `Var
24
| `Cite | `Abbr | `Acronym | `Sub | `Sup | `Input | `Select
25
| `Textarea | `Label | `Button | `Ins | `Del | `Script | `Noscript
26
| `A | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Ul | `Ol | `Dl | `Pre
27
| `Hr | `Blockquote | `Address | `P | `Div | `Fieldset | `Table
28
| `Form | `Html | `Head | `Body | `Title | `Base | `Style | `Meta
29
| `Link | `Li | `Dt | `Dd | `Param | `Area | `Optgroup | `Option
30
| `Legend | `Caption | `Thead | `Tfoot | `Tbody | `Colgroup
31
| `Col | `Tr | `Th | `Td]
34
type xhtml = [ = `Html ];
35
type form = [ = `Form ];
37
type img = [ = `Img ];
38
type link = [ = `Link ];
39
type script = [ = `Script ];
40
type input = [ = `Input ];
41
type textarea = [ = `Textarea ];
42
type select = [ = `Select ];
43
type selectoption = [ = `Option ];
44
type optgroup = [ = `Optgroup ];
45
type button = [ = `Button ];
46
type pcdata = [ = `PCDATA ];
48
type html_content = [ = `Body | `Head | `Frameset ];
49
type body_content = block;
50
(* [ `Address | `Blockquote | `Del | `Div | `Dl | `Fieldset
51
| `Form | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `Ins | `Noscript | `Ol
52
| `P | `Pre | `Script | `Table | `Ul ] *)
53
type div_content = [ = `PCDATA | flow ];
54
(* [ `A | `Abbr | `Acronym | `Address | `B | `Bdo | `Big | `Blockquote | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Div | `Dl | `Em | `Fieldset | `Form | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `I | `Img | `Input | `Ins | `Kbd | `Label | `Map | `Noscript | `Object | `Ol | `P | `PCDATA | `Pre | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Table | `Textarea | `Tt | `Ul | `Var ] *)
55
type object_content = [ = `PCDATA | flow | `Param ];
56
(* [ `A | `Abbr | `Acronym | `Address | `B | `Bdo | `Big | `Blockquote | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Div | `Dl | `Em | `Fieldset | `Form | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `I | `Img | `Input | `Ins | `Kbd | `Label | `Map | `Noscript | `Object | `Ol | `P | `Param | `PCDATA | `Pre | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Table | `Textarea | `Tt | `Ul | `Var ] *)
57
type fieldset_content = [ = `PCDATA | `Legend | flow ];
58
(* [ `A | `Abbr | `Acronym | `Address | `B | `Bdo | `Big | `Blockquote | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Div | `Dl | `Em | `Fieldset | `Form | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `I | `Img | `Input | `Ins | `Kbd | `Label | `Legend | `Map | `Noscript | `Object | `Ol | `P | `PCDATA | `Pre | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Table | `Textarea | `Tt | `Ul | `Var ] *)
59
type button_content = [ = `PCDATA | buttoncontent ];
60
(* [ `Abbr | `Acronym | `Address | `B | `Bdo | `Big | `Blockquote | `Br | `Cite | `Code | `Del | `Dfn | `Div | `Dl | `Em | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `I | `Img | `Ins | `Kbd | `Map | `Noscript | `Object | `Ol | `P | `PCDATA | `Pre | `Q | `Samp | `Script | `Small | `Span | `Strong | `Sub | `Sup | `Table | `Tt | `Ul | `Var ] *)
62
[ = `Base | `Link | `Object | `Script | `Style | `Title | `Meta
64
(* [ `Base | `Link | `Object | `Script | `Style | `Title | `Meta ] *)
65
type form_content = [ = block_sans_form | `Fieldset ];
66
(* [ `Address | `Blockquote | `Del | `Div | `Dl | `Fieldset | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `Ins | `Noscript | `Ol | `P | `Pre | `Script | `Table | `Ul ] *)
67
type blockquote_content = [ = `PCDATA | block ];
68
(* [ `Address | `Blockquote | `Del | `Div | `Dl | `Fieldset | `Form | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `Ins | `Noscript | `Ol | `P | `Pre | `Script | `Table | `Ul ] *)
69
type map_content = [ = block | `Area ];
70
(* [ `Address | `Area | `Blockquote | `Del | `Div | `Dl | `Fieldset | `Form | `H1 | `H2 | `H3 | `H4 | `H5 | `H6 | `Hr | `Ins | `Noscript | `Ol | `P | `Pre | `Script | `Table | `Ul ] *)
71
(* type inline_content =
72
[ `A | `Abbr | `Acronym | `B | `Bdo | `Big | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Em | `I | `Img | `Input | `Ins | `Kbd | `Label | `Map | `Object | `PCDATA | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Textarea | `Tt | `Var ]
74
type inlinemix = [ = `PCDATA | inline ];
75
(* [ `A | `Abbr | `Acronym | `B | `Bdo | `Big | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Em | `I | `Img | `Input | `Ins | `Kbd | `Label | `Map | `Object | `PCDATA | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Textarea | `Tt | `Var ] *)
76
type label_content = [ = `PCDATA | inline_sans_label ];
77
(* [ `A | `Abbr | `Acronym | `B | `Bdo | `Big | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Em | `I | `Img | `Input | `Ins | `Kbd | `Map | `Object | `PCDATA | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Textarea | `Tt | `Var | `Noscript ] *)
78
type a_content = [ = `PCDATA | inline_sans_a_mix ];
79
(* [ `Abbr | `Acronym | `B | `Bdo | `Big | `Br | `Button | `Cite | `Code | `Del | `Dfn | `Em | `I | `Img | `Input | `Ins | `Kbd | `Label | `Map | `Object | `PCDATA | `Q | `Samp | `Script | `Select | `Small | `Span | `Strong | `Sub | `Sup | `Textarea | `Tt | `Var | `Noscript ] *)
80
type pre_content = [ = `PCDATA | precontent ];
81
(* [ `A | `Abbr | `Acronym | `B | `Bdo | `Br | `Cite | `Code | `Dfn | `Em | `I | `Kbd | `Map | `PCDATA | `Q | `Samp | `Script | `Span | `Strong | `Tt | `Var ] *)
82
type dl_content = [ = `Dd | `Dt ];
83
type optgroup_content = [ = `Option ];
84
type colgroup_content = [ = `Col ];
85
type ul_content = [ = `Li ];
86
type select_content = [ = `Optgroup | `Option ];
87
type tbody_content = [ = `Tr ];
89
[ = `Caption | `Col | `Colgroup | `Tbody | `Tfoot | `Thead | `Tr
91
type tr_content = [ = `Td | `Th ];
92
type abbr_content = inlinemix;
93
type acronym_content = inlinemix;
94
type address_content = inlinemix;
95
type b_content = inlinemix;
96
type bdo_content = inlinemix;
97
type big_content = inlinemix;
98
type caption_content = inlinemix;
99
type cite_content = inlinemix;
100
type code_content = inlinemix;
101
type dfn_content = inlinemix;
102
type dt_content = inlinemix;
103
type em_content = inlinemix;
104
type h1_content = inlinemix;
105
type h2_content = inlinemix;
106
type h3_content = inlinemix;
107
type h4_content = inlinemix;
108
type h5_content = inlinemix;
109
type h6_content = inlinemix;
110
type i_content = inlinemix;
111
type kbd_content = inlinemix;
112
type legend_content = inlinemix;
113
type p_content = inlinemix;
114
type q_content = inlinemix;
115
type samp_content = inlinemix;
116
type small_content = inlinemix;
117
type span_content = inlinemix;
118
type strong_content = inlinemix;
119
type sub_content = inlinemix;
120
type sup_content = inlinemix;
121
type tt_content = inlinemix;
122
type var_content = inlinemix;
123
type dd_content = div_content;
124
type del_content = div_content;
125
(* type div_content = div_content *)
126
type ins_content = div_content;
127
type li_content = div_content;
128
type th_content = div_content;
129
type td_content = div_content;
130
(* type tbody_content = body_content *)
131
type noscript_content = body_content;
132
type area_content = notag;
133
type base_content = notag;
134
type br_content = notag;
135
type col_content = notag;
136
type hr_content = notag;
137
type img_content = notag;
138
type input_content = notag;
139
type meta_content = notag;
140
type param_content = notag;
142
type object_content = object_content
143
type fieldset_content = fieldset_content
144
type head_content = head_content
145
type form_content = form_content
146
type map_content = map_content
147
type label_content = label_content
148
type a_content = a_content
149
type pre_content = pre_content
150
type dl_content = dl_content
151
type optgroup_content = optgroup_content
152
type colgroup_content = colgroup_content
153
type ul_content = ul_content
154
type select_content = select_content
155
type table_content = table_content
156
type tr_content = tr_content
157
type button_content = button_content
158
type blockquote_content = blockquote_content
160
type link_content = pcdata;
161
type option_content = pcdata;
162
type script_content = pcdata;
163
type style_content = pcdata;
164
type textarea_content = pcdata;
165
type title_content = pcdata;
166
type ol_content = ul_content;
167
type thead_content = tbody_content;
168
type tfoot_content = tbody_content;
170
[ = common | `Accesskey | `Charset | `Href | `Hreflang | `Name_01_00 | `Rel
171
| `Rev | `Tabindex | `Target | `Type | `Shape | `Coords
174
[ = common | `Charset | `Href | `Hreflang | `Media | `Rel | `Rev | `Target
177
type script_attrib = [ = `XMLns | `Charset | `Src | `Defer | `XML_space ];
179
[ = common | `Enctype | `Method | `Name_01_00 | `Target | `Accept_charset
183
[ = common | `Height | `Longdesc | `Name_01_00 | `Width | `Usemap
185
type div_attrib = common;
187
[ = common | `Accesskey | `Checked | `Maxlength | `Name | `Size | `Src
188
| `Tabindex | `Input_Type | `Value | `Disabled | `Readonly | `Alt
191
type textarea_attrib =
192
[ = common | `Accesskey | `Name | `Tabindex | `Disabled | `Readonly
195
[ = common | `Multiple | `Name | `Size | `Tabindex | `Disabled
197
type optgroup_attrib = [ = common | `Disabled | `Label ];
198
type option_attrib = [ = common | `Selected | `Value | `Disabled | `Label ];
199
type button_attrib = [ = common | `Name | `Value | `Button_Type ];
200
type fieldset_attrib = common;
201
type label_attrib = [ = common | `Accesskey | `For ];
202
type legend_attrib = [ = common | `Accesskey ];