summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/resources/webidl2/test/widlproc/doc/widlproc.html
blob: 4eb42c39bb9c104d4e816b63627a3572f261dae6 (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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--====================================================================
Copyright 2009 Aplix Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=====================================================================-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>widlproc</title>
<style type="text/css">
    body { color: black; font: 10pt verdana; }
    a:link { text-decoration: none; }
    a:visited { text-decoration: none; }
    a:hover { text-decoration: underline; }
    dt { margin-top: 0.5em; }
    dd { margin-left: 1em; margin-bottom: 0.5em; }
    li { margin-bottom: 0; }
    h4 { font-size: 10pt; }
    table { border: 1px solid; border-collapse: collapse; }
    td { border: 1px solid; }
    th { border: 1px solid; }
    code { background-color: #f0f0f0; }
    pre { background-color: #f0f0f0; }
    .indent { margin-left: 3em; }
    .issue { background-color: #00CCCC; }
</style>
</head>
<body>
<h1>widlproc</h1>

<p>Tim Renouf, Aplix Corp</p>
<p>$Id$
</p>

<h2>Introduction</h2>

<p>
widlproc is a processor that accepts as input
<a href="#webidl">Web IDL</a> (the 30 September 2009 editor's draft),
with comments in a subset of the format used by
<a href="#doxygen">Doxygen</a>.
The format it accepts is proposed by Aplix for authoring
<a href="#bondi">BONDI</a> interface definitions.
</p>

<p>
The output of widlproc is an XML representation of the
<a href="#webidl">Web IDL</a> input,
with added XML elements representing the
<a href="#doxygen">Doxygen</a>-like comments.
</p>

<h2>Usage</h2>

<p>
<code>widlproc <i>filename</i></code>
</p>

<p>
widlproc reads the file named <em>filename</em>, and 
sends its XML output format to stdout.
</p>

<h2>Input format</h2>

<p>
The input format accepted by widlproc is
<a href="#webidl">Web IDL</a>
(with an extension used in the
<a href="#w3cgeo">W3C Geolocation API</a>),
with comments in a format reminiscent of that used by
<a href="#doxygen">Doxygen</a>.
</p>

<h3>Web IDL extension from W3C geolocation API</h3>

<h4>double</h4>

<p>
<code>double</code> is allowed as a DeclarationType or a BoxedType.
</p>

<h3>Doxygen-like comment introduction</h3>

<p>
Only a small subset of Doxygen functionality is supported by
widlproc, plus additions to handle the BONDI concepts of API features
and device capabilities.
</p>

<p>
In particular, no links are added automatically. (This could be added
in the future.)
</p>

<h3>Doxygen comment block</h3>

<h4>Comment referral point</h4>

<p>
Each <em>Doxygen comment block</em> refers to a <em>comment referral
point</em> in the Web IDL, one of
module, interface, exception, const, attribute, operation or argument.
</p>

<h4>Block comment</h4>

<p>
A block comment (delimited by <code>/* */</code>) whose first character
after the <code>/*</code> is <code>!</code> or a second <code>*</code>
is a <em>Doxygen comment block</em>.
</p>

<p>
Normally the comment block refers to the next comment referral point in
the Web IDL.
If the first character is <code>&lt;</code>, so the comment block is introduced
with <code>/**&lt;</code> or <code>/*!&lt;</code> , then the comment block
refers back to the previous comment referral point.
</p>

<p>
The text of the comment block
excludes the initial <code>!</code> or <code>*</code> (and the <code>&lt;</code>
for a referring back block),
and excludes an initial (after whitespace) <code>*</code>
on each line,
and, when not in a <a href="#code"><code>\code</code></a> block,
excludes any line consisting entirely of whitespace, then <code>*</code>
characters, then whitespace.
</p>

<p>
widlproc does not support Doxygen commands to force a comment
block to refer to a different referral point.
</p>

<h4>Inline comments</h4>

<p>
The maximal sequence of inline comments (delimited by <code>//</code>)
on adjacent lines, where all of the following conditions hold:
</p>
<ul>
<li>
each has a first character after the <code>/</code> of <code>!</code> or
a third <code>/</code>;
<li>
no comment referral point intervenes;
<li>
either each comment in the sequence starts with a <code>&lt;</code>
(see below), or none does;
<li>
the sequence contains at least two inline comments, or, if only one,
then it starts with <code>&lt;</code> (see below);
</ul>
<p>
forms a <em>Doxygen comment block</em>.
</p>

<p>
Normally the comment block refers to the next comment referral point in
the Web IDL.
If the first character of each comment is <code>&lt;</code>, so each
comment in the block is introduced
with <code>///&lt;</code> or <code>//!&lt;</code> , then the comment block
refers back to the previous comment referral point.
</p>

<p>
The text of the comment block
excludes the initial <code>!</code> or <code>/</code> (and the <code>&lt;</code>
for a referring back block) of each inline comment,
and, when not in a <a href="#code"><code>\code</code></a> block,
excludes any line consisting entirely of whitespace, then <code>/</code>
characters, then whitespace.
</p>

<p>
widlproc does not support Doxygen commands to force a comment
block to refer to a different referral point.
</p>

<h3>Paragraph</h3>

<p>
A comment block is broken into zero or more <em>paragraph</em>s.
One or more blank lines break the paragraphs (unless in a
<a href="#code"><code>\code</code></a> block).
</p>

<p>
Certain commands (below) also start a new paragraph.
</p>

<p>
An
<a href="#html">HTML block element</a>
is a paragraph.
A blank line (other than in a
<a href="#code"><code>\code</code></a> block)
implicitly closes any open HTML elements, thus ending the paragraph.
</p>

<h3>Doxygen-like commands</h3>

<p>
widlproc supports a small subset of Doxygen commands, plus some additions
to handle BONDI API features and device capabilities.
</p>

<p>
A command is always introduced with a <code>\</code> character.
The Doxygen alternative (from JavaDoc) of <code>@</code> is not
supported.
</p>

<h4 id="api-feature">\api-feature</h4>

<p>
Starts a new paragraph. The following word is the name of an API feature
used by the method being documented. The remainder of the paragraph is
any description required of how (eg in what circumstance) the API feature
is used.
</p>

<h4>\name</h4>

<p>
Declares a name for the document node associated with the current referral
point. This is useful for the root document node that otherwise does not have
a WebIDL identifier.
</p>

<h4>\author</h4>

<p>
Starts a new paragraph. The remainder of the paragraph contains
information about a single author of the specification. Multiple
<code>\author</code> commands should be used for multiple authors.
</p>

<p>
(Here widlproc differs from Doxygen; Doxygen also allows
multiple authors on separate lines to appear in one <code>\author</code>
paragraph.)
</p>

<h4>\b</h4>

<p>
This renders the next word as bold. It is equivalent to enclosing the
next word with <code>&lt;b> &lt;/b></code>.
</p>

<h4>\brief</h4>

<p>
Starts a new paragraph. The remainder of the paragraph contains a brief
description of the entity being documented.
</p>

<h4 id="code">\code, \endcode</h4>

<p>
<code>\code</code>
starts a new paragraph which is a <em>code block</em>. The code block
ends at the next <code>\endcode</code> command.
</p>

<p>
Within the code block, whitespace and newlines are passed verbatim into
the output.
</p>

<h4 id="def-api-feature">\def-api-feature</h4>

<p>
Starts a new paragraph. The following word is the name of the API feature
which is defined here. The description is an <em>def-api-feature block</em>,
consisting of the
remainder of the paragraph, together with
further paragraphs in the same block comment each of which is a plain
paragraph, a paragraph started due to HTML markup, a <code>\brief</code>
paragraph, or a
<a href="#device-cap"><code>\device-cap</code></a>
paragraph.
</p>

<h4 id="def-api-feature-set">\def-api-feature-set</h4>

<p>
Starts a new paragraph. The following word is the name of the API feature
set which is defined here. The description is an <em>def-api-feature-set block</em>,
consisting of the
remainder of the paragraph, together with
further paragraphs in the same block comment each of which is a plain
paragraph, a paragraph started due to HTML markup, a <code>\brief</code>
paragraph, or a
<a href="#device-cap"><code>\api-feature</code></a>
paragraph.
</p>

<h4>\def-device-cap</h4>

<p>
Starts a new paragraph. The following word is the name of the device capability
which is defined here. The description consists of the
remainder of the paragraph, together with
further paragraphs in the same block comment each of which is a plain
paragraph, a paragraph started due to HTML markup, a <code>\brief</code>
paragraph, or a
<a href="#param"><code>\param</code></a>
paragraph.
</p>

<h4 id="def-instantiated">\def-instantiated</h4>

<p>
Starts a new paragraph.  The description is an <em>def-instantiated block</em>,
consisting of the
remainder of the paragraph, together with
further paragraphs in the same block comment each of which is a plain
paragraph, a paragraph started due to HTML markup, a <code>\brief</code>
paragraph, or a
<a href="#api-feature"><code>\api-feature</code></a>
paragraph.
</p>

<h4 id="device-cap">\device-cap</h4>

<p>
Starts a new paragraph.
This command can appear only inside an
<a href="#def-api-feature">def-api-feature block</a>.
The following word is the name of a device capability
used by the API feature being documented.
The remainder of the paragraph is
any description required of how (eg in what circumstance) the device capability
is used.
</p>

<h4>\n</h4>

<p>
Creates a line break in the output.
</p>

<h4 id="param">\param</h4>

<p>
Starts a new paragraph. This takes the following word as the name of
a parameter (argument) of the entity being documented, then makes the
remainder of the paragraph refer to that parameter.
</p>

<h4>\return</h4>

<p>
Starts a new paragraph. The remainder of the paragraph is made to refer to
the return type of the entity being documented.
</p>

<h4>\throw</h4>

<p>
Starts a new paragraph. The next word is taken to be the name of an
exception thrown by the entity being documented, and the remainder of
the paragraph documents that exception (in the <code>raises</code> list of
an <code>operation</code>, or the <code>setraises</code>
clause of an <code>attribute</code>).
</p>

<h4>\version</h4>

<p>
Starts a new paragraph. The remainder of the paragraph contains
version number information.
</p>

<h3>Escape sequences</h3>

<p>
The following escape sequences are recognized in a comment block:
</p>

<table>
<tr>
<th>escape sequence
<th>result
<tr>
<td><code>\\</code>
<td><code>\</code>
<tr>
<td><code>\&amp;</code>
<td><code>&amp;</code> (escaped to <code>&amp;amp;</code> in output XML)
<tr>
<td><code>\$</code>
<td><code>$</code>
<tr>
<td><code>\#</code>
<td><code>#</code>
<tr>
<td><code>\&lt;</code>
<td><code>&lt;</code> (escaped to <code>&amp;lt;</code> in output XML)
<tr>
<td><code>\></code>
<td><code>></code>
<tr>
<td><code>\%</code>
<td><code>%</code>
</table>

<p>
Some of these escape sequences are used to avoid Doxygen features that
widlproc does not currently implement. In particular,
widlproc insists on a <code>$</code> being escaped, to
allow for possible future functionality.
</p>

<h3 id="html">HTML in comments</h3>

<p>
widlproc accepts a small subset of HTML elements.
</p>

<p>
An HTML block element is a paragraph.
A blank line (other than in a
<a href="#code"><code>\code</code></a> block)
implicitly closes any open HTML elements, thus ending the paragraph.
</p>

<p>
The following HTML block elements are accepted:
<code>dl</code>
<code>ol</code>
<code>p</code>
<code>table</code>
<code>ul</code>
</p>

<p>
The following HTML inline elements are accepted:
<code>a</code>
<code>img</code>
<code>b</code>
<code>br</code>
<code>em</code>
</p>

<p>
The following HTML elements are accepted where valid inside one of the
other elements:
<code>dd</code>
<code>dt</code>
<code>li</code>
<code>td</code>
<code>th</code>
<code>tr</code>
</p>


<h2>Output format</h2>

<p>
The output of widlproc is an XML representation of the
<a href="#webidl">Web IDL</a>,
with added XML elements representing the
<a href="#doxygen">Doxygen</a>-like comments.
</p>

<h3>Annotated document type declaration</h3>

<pre class="dtd">
&lt;!-- Autogenerated from widlproc.html : do not edit. -->
</pre>

<h4>Entities used elsewhere</h4>

<pre class="dtd">
&lt;!ENTITY % block 'dl | p | table | ul' >
&lt;!ENTITY % Block '(%block;)*' >
&lt;!ENTITY % inline 'a | b | br | em | img' >
&lt;!ENTITY % Inline '(#PCDATA | %inline;)*' >
&lt;!ENTITY % Flow '(#PCDATA | %inline; | %block;)*' >

&lt;!ELEMENT webidl (#PCDATA | ref)* >
</pre>

<p>
The <code>&lt;webidl></code> element contains the literal text of the
original Web IDL that the parent
element was parsed from, minus the comments, with each reference to
an interface name 
enclosed in a <code>&lt;ref></code>..<code>&lt;/ref></code>.
</p>

<h4>Definitions</h4>

<p>
<em>Definitions</em> is the root element of the XML document.
</p>

<p>
The <em>ExtendedAttributeList</em> specifies any extended attributes
for the  <em>Interface</em>, <em>Dictionary</em>, <em>Exception</em>,
<em>Typedef</em>, <em>Valuetype</em> or <em>Const</em> in the
<em>Definition</em>.
</p>

<pre class="dtd">
&lt;!ELEMENT Definitions ( webidl, descriptive?, (Interface | Dictionary | Callback
    | Enum | Exception | Typedef | Implements)*) >
</pre>

<h4>Interface</h4>

<p>
An <em>Interface</em> represents an interface. The <em>name</em>
attribute specifies the name of the interface. The <em>descriptive</em> element
provides its documentation if any.
The <em>id</em> attribute specifies the absolute scoped name of the interface.
</p>

<p>The <em>partial</em> attribute indicates that the definition of the interface complements an existing definition. The <em>callback</em> attribute specificies that a given interface is a callback interface.</p>

<p>
The <em>InterfaceInheritance</em> element indicates that the interface
inherits from other interface(s). Each <em>Name</em> in the
<em>InterfaceInheritance</em> has a <em>name</em> attribute giving the
scoped name of the interface being inherited from.
</p>

<pre class="dtd">
&lt;!ELEMENT Interface (webidl, descriptive?, ExtendedAttributeList?,
        InterfaceInheritance?, (Const | Attribute | Operation | Stringifier* | Serializer* | Iterator | IteratorObject)* ) >
&lt;!ATTLIST Interface name CDATA #REQUIRED
                    partial (partial) #IMPLIED
                    callback (callback) #IMPLIED
                    id CDATA #REQUIRED >

&lt;!ELEMENT InterfaceInheritance (Name+) >

&lt;!ELEMENT Name EMPTY >
&lt;!ATTLIST Name name CDATA #REQUIRED >
</pre>

<h4>Dictionary</h4>

<p>
A <em>Dictionary</em> represents a dictionary. The <em>name</em>
attribute specifies the name of the dictionary. The <em>descriptive</em> element
provides its documentation if any.
The <em>id</em> attribute specifies the absolute scoped name of the dictionary.
</p>

<p>The <em>partial</em> attribute indicates that the definition of the interface complements an existing definition.</p>

<p>
The <em>DictionaryInheritance</em> element indicates that the dictionary
inherits from other dictionary(s). Each <em>Name</em> in the
<em>DictionaryInheritance</em> has a <em>name</em> attribute giving the
scoped name of the dictionary being inherited from.
</p>


<pre class="dtd">
&lt;!ELEMENT Dictionary (webidl, descriptive?, DictionaryInheritance?, DictionaryMember* ) >
&lt;!ATTLIST Dictionary name CDATA #REQUIRED
                    partial (partial) #IMPLIED
                    id CDATA #REQUIRED >

&lt;!ELEMENT DictionaryInheritance (Name+) >
</pre>

<h4>Callback</h4>

<p>
A <em>Callback</em> represents a callback type. The <em>name</em>
attribute specifies the name of the dictionary. The <em>descriptive</em> element
provides its documentation if any.</p>

<p>The <em>Type</em> element specifies its return type.</p>

<p>
An <em>Argument</em> is an argument to an operation.
The <em>Type</em> element specifies its type. The <em>name</em>
attribute specifies its name if it has one.
</p>

<pre class="dtd">
&lt;!ELEMENT Callback (webidl, descriptive?, Type, ArgumentList? ) >
&lt;!ATTLIST Callback name CDATA #REQUIRED
                      id CDATA #REQUIRED>
</pre>


<h4>Enum</h4>

<p>
An <em>Enum</em> represents an enumeration. The <em>name</em>
attribute specifies the name of the enumeration. The <em>descriptive</em> element
provides its documentation if any.
</p>

<p>
The <em>EnumValue</em> element indicates the values defined for that enumeration in its <em>stringvalue</em> attribute.
</p>


<pre class="dtd">
&lt;!ELEMENT Enum (webidl, descriptive?, EnumValue* ) >
&lt;!ATTLIST Enum name CDATA #REQUIRED 
                    id CDATA #REQUIRED >

&lt;!ELEMENT EnumValue (webidl, descriptive?) >
&lt;!ATTLIST EnumValue stringvalue CDATA #REQUIRED >
</pre>



<h4>Exception</h4>

<p>
An <em>Exception</em> represents an exception.
The <em>name</em>
attribute specifies the name of the exception.
The <em>descriptive</em> element
provides its documentation if any.
The <em>id</em> attribute specifies the absolute scoped name of the exception.
</p>

<p>
An <em>ExceptionField</em> represents a field in an exception.
The <em>name</em>
attribute specifies the name of the field.
The <em>Type</em> element specifies its type.
The <em>descriptive></em> element
provides its documentation if any.
The <em>id</em> attribute specifies the absolute scoped name of the field.
</p>

<p>
The <em>ExceptionInheritance</em> element indicates that the exception
inherits from another exception. The <em>Name</em> in the
<em>ExceptionInheritance</em> has a <em>name</em> attribute giving the
scoped name of the exception being inherited from.
</p>


<pre class="dtd">
&lt;!ELEMENT Exception (webidl, descriptive?, ExtendedAttributeList?, ExceptionInheritance?,
        (Const | ExceptionField)* ) >
&lt;!ATTLIST Exception name CDATA #REQUIRED 
                    id CDATA #REQUIRED >

&lt;!ELEMENT ExceptionInheritance (Name) >
&lt;!ELEMENT ExceptionField (webidl, descriptive?, ExtendedAttributeList?, (Type)) >
&lt;!ATTLIST ExceptionField name CDATA #REQUIRED
                         id CDATA #REQUIRED >
</pre>

<h4>Typedef</h4>

<p>
A <em>Typedef</em> represents a type definition.
The <em>name</em>
attribute specifies the name of the new type.
The <em>Type</em> element specifies it in terms of other types.
The <em>descriptive></em> element
provides its documentation if any.
The <em>id</em> attribute specifies the absolute scoped name of the typedef.
</p>

<pre class="dtd">
&lt;!ELEMENT Typedef (webidl, descriptive?, ExtendedAttributeList?, (Type)) >
&lt;!ATTLIST Typedef name CDATA #REQUIRED
                  id CDATA #REQUIRED >
</pre>

<h4>Implements</h4>

<p>
An <em>Implements</em> represents Web IDL's
<code><i>ScopedName</i> implements <i>ScopedName</i>;</code>
syntax. The <em>name1</em> and <em>name2</em> attributes give the
first and second scoped names respectively.
The <em>descriptive></em> element
provides the <em>Implements</em>'s documentation if any.
</p>

<pre class="dtd">
&lt;!ELEMENT Implements (webidl, descriptive?, ExtendedAttributeList?) >
&lt;!ATTLIST Implements name1 CDATA #REQUIRED
                     name2 CDATA #REQUIRED >
</pre>

<h4>Const</h4>

<p>
<em>Const</em> represents Web IDL's
<code>const <i>Type</i> <i>identifier</i> = <i>ConstExpr</i>;</code>
syntax.
The <em>Type</em> specifies the constant's type, the
<em>name</em> attribute specifies the constant's name, and the
<em>value</em> attribute specifies its value.
The <em>descriptive></em> element
provides the <em>Const</em>'s documentation if any.
The <em>id</em> attribute specifies the absolute scoped name of the const.
</p>

<pre class="dtd">
&lt;!ELEMENT Const (webidl, descriptive?, ExtendedAttributeList?, Type) >
&lt;!ATTLIST Const name CDATA #REQUIRED
                value CDATA #IMPLIED
                id CDATA #REQUIRED >
</pre>

<h4>Stringifier</h4>

<p>
A <em>Stringifier</em> represents the Web IDL <code>stringifier;</code>
syntax as an interface member.
The <em>descriptive></em> element
provides the <em>Stringifier</em>'s documentation if any.
</p>

<pre class="dtd">
&lt;!ELEMENT Stringifier (webidl, descriptive?, ExtendedAttributeList?) >
</pre>

<h4>Attribute</h4>

<p>
An <em>Attribute</em> represents an attribute as an interface member.
The <em>Type</em> element specifies its type. The <em>name</em>
attribute specifies its name. Each of the <em>stringifier</em>, <em>static</em> and
<em>readonly</em> attributes is set to a value the same as the attribute
name when the corresponding keyword appears in the Web IDL input. The <em>inherit</em> attribute is set to <em>inherit</em> when the attribute inherits its getter.
</p>


<p>
The <em>descriptive></em> element provides the attribute's documentation
if any.
The <em>id</em> attribute specifies the absolute scoped name of the attribute.
</p>

<pre class="dtd">
&lt;!ELEMENT Attribute (webidl, descriptive?, ExtendedAttributeList?, (Type)) >
&lt;!ATTLIST Attribute stringifier (stringifier) #IMPLIED
                    readonly (readonly) #IMPLIED
                    inherit (inherit) #IMPLIED
                    static (static) #IMPLIED
                    name CDATA #REQUIRED
                    id CDATA #REQUIRED >

</pre>


<h4>Operation</h4>

<p>
An <em>Operation</em> represents a method on interface.
The <em>Type</em> element specifies its return type. The <em>name</em>
attribute specifies its name.
</p>

<p>
Each of the <em>stringifier</em>, <em>static</em>, <em>getter</em>,
<em>setter</em>, <em>creator</em>, <em>deleter</em> and <em>legacycaller</em>, <em>serializer</em>
attributes is set to a value the same as the attribute
name when the corresponding keyword appears in the Web IDL input.
</p>


<p>
The <em>descriptive></em> element provides the attribute's documentation
if any.
The <em>id</em> attribute specifies the absolute scoped name of the operation if it has one.
</p>

<p>
An <em>Argument</em> is an argument to an operation.
The <em>Type</em> element specifies its type. The <em>name</em>
attribute specifies its name if it has one.
</p>

<p>
Each of the <em>optional</em> and <em>ellipsis</em>
attributes is set to a value the same as the attribute
name when the corresponding syntax appears in the Web IDL input.
</p>

<p>The
<em>value</em> attribute used on optional arguments specifies default value for non-string values, and <em>stringvalue</em> for string values.</p>


<pre class="dtd">
&lt;!ELEMENT Operation (webidl, descriptive?, ExtendedAttributeList?,
        (Type), ArgumentList) >
&lt;!ATTLIST Operation stringifier (stringifier) #IMPLIED
                    static (static) #IMPLIED
                    getter (getter) #IMPLIED
                    setter (setter) #IMPLIED
                    creator (creator) #IMPLIED
                    deleter (deleter) #IMPLIED
                    serializer (serializer) #IMPLIED
                    legacycaller (legacycaller) #IMPLIED
                    name NMTOKEN #IMPLIED
                    id NMTOKEN #IMPLIED >


&lt;!ELEMENT ArgumentList (Argument*) >

&lt;!ELEMENT Argument (descriptive?, ExtendedAttributeList?, (Type)) >
&lt;!ATTLIST Argument
                   optional (optional) #IMPLIED
                   ellipsis (ellipsis) #IMPLIED
                value CDATA #IMPLIED
                stringvalue CDATA #IMPLIED
                   name NMTOKEN #REQUIRED >
</pre>

<h4>Serializer</h4>
<p>A <em>Serializer</em> represents a serializer for an interface, either defined in the prose or via a pattern.</p>

<p>The <em>descriptive</em> element provides the serializer's documentation if any.</p>


<p>The <em>attribute</em> attribute defines the attribute that is used for serialization if any.</p>

<p>The optional <em>Map</em> and <em>List</em> elements describe the pattern (if any) for the serializer. They take <em>PatternAttribute</em> elements with a <em>name</em> attribute that describes the attributes used for serialization.</p>

<p><em>Map</em> elements take a <em>pattern</em> attribute that can be set to either "getter" (if the getter is used for serialization), "all" if all serializable attributes are to be used, or "selection" if the attributes named as children elements are to be used. Optionally, they take a <em>inherit</em> attribute set to "inherit" if the serialization takes also into account inherited attributes.</p>

<p><em>List</em> elements take a <em>pattern</em> attribute that can be set to either "getter" (if the getter is used for serialization), or "selection" if the attributes named as children elements are to be used.</p>

<pre class="dtd">
&lt;!ELEMENT Serializer (webidl, descriptive?, ExtendedAttributeList?, (Map | List)?) >
&lt;!ATTLIST Serializer attribute CDATA #IMPLIED >

&lt;!ELEMENT Map  ((PatternAttribute*)) >

&lt;!ATTLIST Map inherit (inherit) #IMPLIED
                 pattern (getter|all|selection) #REQUIRED>

&lt;!ELEMENT List  ((PatternAttribute*)) >

&lt;!ATTLIST List pattern (getter|selection) #REQUIRED>

&lt;!ELEMENT PatternAttribute EMPTY>
&lt;!ATTLIST PatternAttribute name CDATA #REQUIRED>

</pre>

<h4>Iterator</h4>
<p>An <em>Iterator</em> element defines  whether the interface has a custom iterator; the type of the iterated objects is defined in the <em>Type</em> child. If that interator implements a particular interface, the name of that interface is set in the <em>interface</em> attribute.</p>
<pre class="dtd">
&lt;!ELEMENT Iterator (webidl, descriptive?, ExtendedAttributeList?, Type) >
&lt;!ATTLIST Iterator interface CDATA #IMPLIED>
</pre>

<h4>IteratorObject</h4>
<p>An <em>IteratorObject</em> element denotes that the interface serves as an iterator object interface; the type of the iterated objects is defined in the <em>Type</em> child.</p>

<pre class="dtd">
&lt;!ELEMENT IteratorObject (webidl, descriptive?, ExtendedAttributeList?, Type) >
</pre>


<h4>DictionaryMember</h4>

<p>
A <em>DictionaryMember</em> represents a member of a dictionary.
The <em>Type</em> element specifies its type. The <em>name</em>
attribute specifies its name. 
</p>

<p>
The <em>descriptive></em> element provides the dictionary member's documentation
if any.
The <em>id</em> attribute specifies the absolute scoped name of the attribute.
</p>

<p>The
<em>value</em> attribute specifies its value for non-string values, and <em>stringvalue</em> for string values.</p>

<pre class="dtd">
&lt;!ELEMENT DictionaryMember (webidl, descriptive?, ExtendedAttributeList?, Type) >
&lt;!ATTLIST DictionaryMember name CDATA #REQUIRED
                    id CDATA #REQUIRED
                value CDATA #IMPLIED
                stringvalue CDATA #IMPLIED >

</pre>


<h4>Extended attributes</h4>

<p>
An <em>ExtendedAttributeList</em> contains one or more
<em>ExtendedAttribute</em> element. Each <em>ExtendedAttribute</em>
has:
</p>
<ul>
<li>
a <em>name</em> attribute giving the name of the extended attribute;
<li>
if the extended attribute contains an <code>=</code> sign followed by a
value, a <em>value</em> attribute giving the value, which is a scoped
name or an identifier;
<li>
if the extended attribute contains parentheses (either with or without
an <code>=</code> sign), an <em>ArgumentList</em> element giving the
contents of the parentheses.
</ul>
<p>
If the <em>value</em> attribute and the <em>ArgumentList</em> element are
both present, then <em>value</em> must give an identifier rather than
a scoped name.
</p>

<pre class="dtd">
&lt;!ELEMENT ExtendedAttributeList (ExtendedAttribute+) >

&lt;!ELEMENT ExtendedAttribute (webidl, ArgumentList?) >
&lt;!ATTLIST ExtendedAttribute name NMTOKEN #REQUIRED
                            value CDATA #IMPLIED >
</pre>

<h4>Type</h4>

<p>
<em>Type</em> represents a type. It has one of these forms:
</p>
<ul>
<li>
The <code>any</code>, <code>object</code> and <code>void</code>
types have the attribute
<em>type</em> set to the type, and no other attributes or elements.
Note that the <code>void</code> type appears only when the <em>Type</em>
element is a child of <em>Operation</em>.
<li>
A type that is an interface has the attribute <em>name</em> set to the
name of that interface, and no other attributes or elements.
<li>
For the primitive types <code>short</code>, <code>unsigned short</code>,
<code>long</code>, <code>unsigned long</code>, <code>long long</code>,
<code>unsigned long long</code>, <code>float</code>, <code>double</code>,
<code>boolean</code>, <code>octet</code>, <code>byte</code> and <code>DOMString</code>,
there is an attribute <em>type</em>
whose value is one of those strings, and no other attributes or elements.
However, if the type was specified in the Web IDL with a trailing <code>?</code>
sign, then there is an attribute <em>nullable</em> with the value
<code>nullable</code>.
</ul>
<p>
The restrictions on which combinations of elements and attributes are
permitted are not encoded by the DTD.
</p>
<p>
The <em>descriptive</em> element provides the documentation
if any, when the <em>Type</em> is a child of <em>Operation</em>, and thus
representing an operation's return type.
</p>

<p>The <em>ExtendedAttributeList</em> element provides the optional extended attributes that can be defined for a type through typedef, &agrave; la <code>typedef [Clamp] octet Value;</code>.</p>

<!-- can't use enumerated values for the values of type, since DTD don't allow enumerated values to have space in them (which would be needed e.g. for "long long") -->
<pre class="dtd">
&lt;!ELEMENT Type (descriptive?, ExtendedAttributeList?, Type*) >
&lt;!ATTLIST Type type CDATA #IMPLIED
               name NMTOKEN #IMPLIED
               nullable (nullable) #IMPLIED >
</pre>

<h4>Sequence</h4>

<p>For a sequence type, the <em>Type</em> element with an attribute <em>type</em> set to <em>sequence</em> contains an element <em>Type</em> giving the sequence element type, and no other attributes or elements. If the sequence is specified in the Web IDL with a trailing <code>?</code>
sign, then there is an attribute <em>nullable</em> with the value
<code>nullable</code>.


<h4>Array</h4>

<p>For an array type, the <em>Type</em> element with an attribute <em>type</em> set to <em>array</em> contains an element <em>Type</em> giving the array element type. If the array is specified in the Web IDL with a trailing <code>?</code>
sign, then there is an attribute <em>nullable</em> with the value
<code>nullable</code>.

<h4>Union</h4>

<p>For a union type, the <em>Type</em> element with an attribute <em>type</em> set to <em>union</em> contains at least two element <em>Type</em> giving the union members type. If the union is specified in the Web IDL with a trailing <code>?</code>
sign, then there is an attribute <em>nullable</em> with the value
<code>nullable</code>.



<h4>Descriptive elements</h4>

<p>
The following elements contain documentation, extracted from the
Doxygen-like comments in the input. <code>&lt;param></code>
derives only from a <code>\param</code> command used inside a
<code>\def-device-cap</code> block; any other <code>\param</code> command
is linked to a parameter (argument) of the method being documented.
</p>

<pre class="dtd">
&lt;!ELEMENT descriptive (description | brief | throw | author
    | version | Code | api-feature | device-cap | def-api-feature
    | def-api-feature-set | def-device-cap | def-instantiated | param)* >

&lt;!ELEMENT description %Block; >

&lt;!ELEMENT brief %Inline; >

&lt;!ELEMENT throw %Inline; >

&lt;!ELEMENT author %Inline; >

&lt;!ELEMENT version %Inline; >

&lt;!ELEMENT Code %Inline; >

&lt;!ELEMENT api-feature %Inline; >
&lt;!ATTLIST api-feature identifier CDATA #REQUIRED >

&lt;!ELEMENT device-cap %Inline; >
&lt;!ATTLIST device-cap identifier CDATA #REQUIRED >

&lt;!ELEMENT param %Inline; >
&lt;!ATTLIST param identifier CDATA #REQUIRED >

&lt;!ELEMENT def-api-feature (descriptive?) >
&lt;!ATTLIST def-api-feature identifier CDATA #REQUIRED >

&lt;!ELEMENT def-api-feature-set (descriptive?) >
&lt;!ATTLIST def-api-feature-set identifier CDATA #REQUIRED >

&lt;!ELEMENT def-instantiated (descriptive?) >

&lt;!ELEMENT def-device-cap (descriptive?) >
&lt;!ATTLIST def-device-cap identifier CDATA #REQUIRED >

&lt;!ELEMENT ref (#PCDATA) >
</pre>

<h4>XHTML elements</h4>

<p>
The following XHTML elements are part of widlprocxml:
</p>

<pre class="dtd">
&lt;!ELEMENT a %Inline; >
&lt;!ATTLIST a href CDATA #REQUIRED >

&lt;!ELEMENT b %Inline; >

&lt;!ELEMENT br EMPTY >

&lt;!ELEMENT dd %Flow; >

&lt;!ELEMENT dl ((dt | dd)*) >

&lt;!ELEMENT dt %Inline; >

&lt;!ELEMENT em %Inline; >

&lt;!ELEMENT img %Inline; >
&lt;!ATTLIST img src CDATA #REQUIRED 
                 alt CDATA #IMPLIED>


&lt;!ELEMENT li %Flow; >

&lt;!ELEMENT p %Inline; >

&lt;!ELEMENT table (tr*) >

&lt;!ELEMENT td %Flow; >

&lt;!ELEMENT th %Flow; >

&lt;!ELEMENT tr ((th | td)*) >

&lt;!ELEMENT ul (li*) >
</pre>


<h2>Bibliography</h2>

<p id="bondi">
BONDI - an open source industry collaboration for widget and web technologies,
<a href="http://bondi.omtp.org/">http://bondi.omtp.org/</a>
</p>

<p id="doxygen">
Doxygen Source code documentation generator tool,
<a href="http://www.stack.nl/~dimitri/doxygen/index.html">
http://www.stack.nl/~dimitri/doxygen/index.html</a>
</p>

<p id="w3cgeo">
W3C Geolocation API Specification Editor's Draft 3 April 2009,
<a href="http://dev.w3.org/geo/api/spec-source.html">
http://dev.w3.org/geo/api/spec-source.html</a>
</p>

<p id="webidl">
Web IDL W3C Editor's Draft 3 May 2011,
<a href="http://dev.w3.org/2006/webapi/WebIDL">http://dev.w3.org/2006/webapi/WebIDL</a>
</p>