~ubuntu-branches/ubuntu/oneiric/ocsigen/oneiric

« back to all changes in this revision

Viewing changes to xmlp4/newocaml/xhtmltypes.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stephane Glondu
  • Date: 2009-07-02 10:02:08 UTC
  • mfrom: (1.1.9 upstream) (4.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090702100208-n158b1sqwzn0asil
Tags: 1.2.0-2
Fix build on non-native architectures

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* Ocsigen
 
2
 * Copyright (C) 2005 Vincent Balat
 
3
 * Laboratoire PPS - CNRS Universit� Paris Diderot
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
18
 *)
 
19
(** XHTML types with variants. (See also {!XHTML.M}) *)
 
20
(* I use these types to constraint typing with the syntax extension *)
 
21
(*
 
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]
 
32
*)
 
33
open XHTML.M;
 
34
type xhtml = [ = `Html ];
 
35
type form = [ = `Form ];
 
36
type a = [ = `A ];
 
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 ];
 
47
type notag;
 
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 ] *)
 
61
type head_content =
 
62
  [ = `Base | `Link | `Object | `Script | `Style | `Title | `Meta
 
63
  ];
 
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 ]
 
73
*)
 
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 ];
 
88
type table_content =
 
89
  [ = `Caption | `Col | `Colgroup | `Tbody | `Tfoot | `Thead | `Tr
 
90
  ];
 
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;
 
141
(*
 
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
 
159
*)
 
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;
 
169
type a_attrib =
 
170
  [ = common | `Accesskey | `Charset | `Href | `Hreflang | `Name_01_00 | `Rel
 
171
    | `Rev | `Tabindex | `Target | `Type | `Shape | `Coords
 
172
  ];
 
173
type link_attrib =
 
174
  [ = common | `Charset | `Href | `Hreflang | `Media | `Rel | `Rev | `Target
 
175
    | `Type
 
176
  ];
 
177
type script_attrib = [ = `XMLns | `Charset | `Src | `Defer | `XML_space ];
 
178
type form_attrib =
 
179
  [ = common | `Enctype | `Method | `Name_01_00 | `Target | `Accept_charset
 
180
    | `Accept
 
181
  ];
 
182
type img_attrib =
 
183
  [ = common | `Height | `Longdesc | `Name_01_00 | `Width | `Usemap
 
184
  ];
 
185
type div_attrib = common;
 
186
type input_attrib =
 
187
  [ = common | `Accesskey | `Checked | `Maxlength | `Name | `Size | `Src
 
188
    | `Tabindex | `Input_Type | `Value | `Disabled | `Readonly | `Alt
 
189
    | `Accept | `Usemap
 
190
  ];
 
191
type textarea_attrib =
 
192
  [ = common | `Accesskey | `Name | `Tabindex | `Disabled | `Readonly
 
193
  ];
 
194
type select_attrib =
 
195
  [ = common | `Multiple | `Name | `Size | `Tabindex | `Disabled
 
196
  ];
 
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 ];
 
203