validate-website 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,8 @@
18
18
  -e 'redirect|news' \ # exclude regex
19
19
  -n # log not found (404)
20
20
  -c "name=val;name2=val2"
21
- -v # verbose
21
+ -v # verbose: show detail of validator errors
22
+ -d # debug: show anemone log
22
23
 
23
24
  == REQUIREMENTS:
24
25
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'find'
6
6
  # Globals
7
7
 
8
8
  PKG_NAME = 'validate-website'
9
- PKG_VERSION = '0.3.5'
9
+ PKG_VERSION = '0.4.0'
10
10
 
11
11
  PKG_FILES = ['README.rdoc', 'Rakefile']
12
12
  Find.find('lib/', 'bin/', 'spec/') do |f|
@@ -10,12 +10,13 @@ require 'validate_website'
10
10
  validate_website = ValidateWebsite.new(ARGV)
11
11
  options = validate_website.options
12
12
 
13
-
14
13
  exit_code = validate_website.crawl options[:site],
15
- :user_agent => options[:useragent],
16
- :authorization => options[:auth],
17
- :cookies => options[:cookies],
18
- :accept_cookies => options[:accept_cookies],
19
- :verbose => options[:verbose]
14
+ :markup_validation => options[:markup_validation],
15
+ :user_agent => options[:useragent],
16
+ :authorization => options[:auth],
17
+ :cookies => options[:cookies],
18
+ :accept_cookies => options[:accept_cookies],
19
+ :verbose => options[:debug],
20
+ :error_verbose => options[:verbose]
20
21
 
21
22
  exit(exit_code)
@@ -4,26 +4,26 @@ require 'validator'
4
4
  require 'anemone'
5
5
  require 'colorful_messages'
6
6
 
7
- include ColorfulMessages
8
-
9
7
  class ValidateWebsite
10
8
 
11
- attr_reader :options
9
+ attr_reader :options, :anemone
12
10
 
13
- attr_reader :anemone
11
+ include ColorfulMessages
14
12
 
15
13
  def initialize(args=[])
16
14
  @options = {
17
- :site => 'http://localhost:3000/',
18
- :useragent => Anemone::Core::DEFAULT_OPTS[:user_agent],
19
- :exclude => nil,
20
- :file => nil,
21
- :auth => nil,
15
+ :markup_validation => true,
16
+ :site => 'http://localhost:3000/',
17
+ :useragent => Anemone::Core::DEFAULT_OPTS[:user_agent],
18
+ :exclude => nil,
19
+ :file => nil,
20
+ :auth => nil,
22
21
  # log not found url (404 status code)
23
- :not_found => false,
24
- :cookies => nil,
25
- :accept_cookies => true,
26
- :verbose => false,
22
+ :not_found => false,
23
+ :cookies => nil,
24
+ :accept_cookies => true,
25
+ :verbose => false,
26
+ :debug => false,
27
27
  }
28
28
  parse(args)
29
29
 
@@ -42,18 +42,24 @@ class ValidateWebsite
42
42
 
43
43
  o.on("-s", "--site=val", String,
44
44
  "Default: #{@options[:site]}") { |v| @options[:site] = v }
45
-
46
45
  o.on("-u", "--useragent=val", String,
47
46
  "Default: #{@options[:useragent]}") { |v| @options[:useragent] = v }
48
47
  o.on("-e", "--exclude=val", String,
49
48
  "Url to exclude") { |v| @options[:exclude] = v }
50
49
  o.on("-f", "--file=val", String,
51
- "save not well formed urls") { |v| @options[:file] = v }
50
+ "Save not well formed urls") { |v| @options[:file] = v }
52
51
  o.on("--auth=[user,pass]", Array,
53
52
  "Basic http authentification") { |v| @options[:auth] = v }
54
- o.on("-n", "--not-found", "Log not found url") { |v| @options[:not_found] = v }
55
53
  o.on("-c", "--cookies=val", "Set defaults cookies") { |v| @options[:cookies] = v }
56
- o.on("-v", "--verbose", "Verbose") { |v| @options[:verbose] = v }
54
+
55
+ o.on("-m", "--[no-]markup-validation",
56
+ "Markup validation (Default: #{@options[:markup_validation]})") { |v| @options[:markup_validation] = v }
57
+ o.on("-n", "--not-found",
58
+ "Log not found url (Default: #{@options[:not_found]})") { |v| @options[:not_found] = v }
59
+ o.on("-v", "--verbose",
60
+ "Show detail of validator errors (Default: #{@options[:verbose]})") { |v| @options[:verbose] = v }
61
+ o.on("-d", "--debug",
62
+ "Show anemone log (Default: #{@options[:debug]})") { |v| @options[:debug] = v }
57
63
 
58
64
  o.separator ""
59
65
  o.on_tail("-h", "--help", "Show this help message.") { puts o; exit }
@@ -80,7 +86,7 @@ class ValidateWebsite
80
86
  exit_code = 0
81
87
 
82
88
  @anemone = Anemone.crawl(site, opts) do |anemone|
83
- anemone.skip_links_like Regexp.new(options[:exclude]) if options[:exclude]
89
+ anemone.skip_links_like Regexp.new(opts[:exclude]) if opts[:exclude]
84
90
 
85
91
  anemone.focus_crawl { |p|
86
92
  links = []
@@ -108,21 +114,24 @@ class ValidateWebsite
108
114
  anemone.on_every_page { |page|
109
115
  url = page.url.to_s
110
116
 
111
- # validate html/html+xml
112
- if page.html? && page.fetched?
113
- print info(url)
114
- validator = Validator.new(page)
115
- msg = " well formed? %s" % validator.valid?
116
- if validator.valid?
117
- puts success(msg)
118
- else
119
- exit_code = 1
120
- puts error(msg)
121
- to_file(url)
117
+ if opts[:markup_validation]
118
+ # validate html/html+xml
119
+ if page.html? && page.fetched?
120
+ print info(url)
121
+ validator = Validator.new(page)
122
+ msg = " well formed? %s" % validator.valid?
123
+ if validator.valid?
124
+ puts success(msg)
125
+ else
126
+ exit_code = 1
127
+ puts error(msg)
128
+ puts error(validator.errors) if opts[:error_verbose]
129
+ to_file(url)
130
+ end
122
131
  end
123
132
  end
124
133
 
125
- if options[:not_found] && page.not_found?
134
+ if opts[:not_found] && page.not_found?
126
135
  exit_code = 1
127
136
  puts error("%s linked in %s but not exist" % [url, page.referer])
128
137
  to_file(url)
@@ -1,34 +1,35 @@
1
1
  class Validator
2
2
  XHTML_PATH = File.join(File.dirname(__FILE__), '..', 'lib', 'xhtml')
3
3
 
4
- attr_accessor :page
5
- attr_accessor :dtd
6
- attr_accessor :namespace
7
- attr_accessor :xsd
8
- attr_accessor :errors
4
+ attr_reader :page, :dtd, :doc, :namespace, :xsd, :errors
9
5
 
10
6
  def initialize(page)
11
7
  @page = page
12
- if @page.doc.internal_subset.system_id
13
- @dtd = URI.parse(@page.doc.internal_subset.system_id)
8
+ @dtd = @page.doc.internal_subset
9
+
10
+ if @dtd.system_id
11
+ @dtd_uri = URI.parse(@dtd.system_id)
14
12
  # http://www.w3.org/TR/xhtml1/#dtds
15
- @namespace = File.basename(@dtd.path, '.dtd')
16
- fixed_dtd = @page.body.sub(@dtd.to_s, @namespace + '.dtd')
17
- doc = Dir.chdir(XHTML_PATH) do
13
+ @namespace = File.basename(@dtd_uri.path, '.dtd')
14
+ fixed_dtd = @page.body.sub(@dtd_uri.to_s, @namespace + '.dtd')
15
+ @doc = Dir.chdir(XHTML_PATH) do
18
16
  Nokogiri::XML(fixed_dtd) { |cfg|
19
17
  cfg.noent.dtdload.dtdvalid
20
18
  }
21
19
  end
20
+
22
21
  # http://www.w3.org/TR/xhtml1-schema/
23
22
  @xsd = Dir.chdir(XHTML_PATH) do
24
23
  if File.exists?(@namespace + '.xsd')
25
24
  Nokogiri::XML::Schema(File.read(@namespace + '.xsd'))
26
25
  end
27
26
  end
28
- @errors = @xsd ? @xsd.validate(doc) : ["Don't have this xsd"]
27
+ @errors = @xsd ? @xsd.validate(@doc) : ["Don't have this xsd"]
29
28
  else
30
- @errors = ['No DTD set !']
29
+ @errors = ['DTD unknown']
31
30
  end
31
+ rescue Nokogiri::XML::SyntaxError => e
32
+ @errors = [e]
32
33
  end
33
34
 
34
35
  def valid?
@@ -0,0 +1,37 @@
1
+ <!--
2
+ This is the HTML 4.01 Frameset DTD, which should be
3
+ used for documents with frames. This DTD is identical
4
+ to the HTML 4.01 Transitional DTD except for the
5
+ content model of the "HTML" element: in frameset
6
+ documents, the "FRAMESET" element replaces the "BODY"
7
+ element.
8
+
9
+ Draft: $Date: 1999/12/24 23:37:45 $
10
+
11
+ Authors:
12
+ Dave Raggett <dsr@w3.org>
13
+ Arnaud Le Hors <lehors@w3.org>
14
+ Ian Jacobs <ij@w3.org>
15
+
16
+ Further information about HTML 4.01 is available at:
17
+
18
+ http://www.w3.org/TR/1999/REC-html401-19991224.
19
+ -->
20
+ <!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Frameset//EN"
21
+ -- Typical usage:
22
+
23
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
24
+ "http://www.w3.org/TR/html4/frameset.dtd">
25
+ <html>
26
+ <head>
27
+ ...
28
+ </head>
29
+ <frameset>
30
+ ...
31
+ </frameset>
32
+ </html>
33
+ -->
34
+
35
+ <!ENTITY % HTML.Frameset "INCLUDE">
36
+ <!ENTITY % HTML4.dtd PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
37
+ %HTML4.dtd;
@@ -0,0 +1,1093 @@
1
+ <!--
2
+ This is the HTML 4.01 Transitional DTD, which includes
3
+ presentation attributes and elements that W3C expects to phase out
4
+ as support for style sheets matures. Authors should use the Strict
5
+ DTD when possible, but may use the Transitional DTD when support
6
+ for presentation attribute and elements is required.
7
+
8
+ HTML 4 includes mechanisms for style sheets, scripting,
9
+ embedding objects, improved support for right to left and mixed
10
+ direction text, and enhancements to forms for improved
11
+ accessibility for people with disabilities.
12
+
13
+ Draft: $Date: 1999/12/24 23:37:48 $
14
+
15
+ Authors:
16
+ Dave Raggett <dsr@w3.org>
17
+ Arnaud Le Hors <lehors@w3.org>
18
+ Ian Jacobs <ij@w3.org>
19
+
20
+ Further information about HTML 4.01 is available at:
21
+
22
+ http://www.w3.org/TR/1999/REC-html401-19991224
23
+
24
+
25
+ The HTML 4.01 specification includes additional
26
+ syntactic constraints that cannot be expressed within
27
+ the DTDs.
28
+
29
+ -->
30
+ <!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Transitional//EN"
31
+ -- Typical usage:
32
+
33
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
34
+ "http://www.w3.org/TR/html4/loose.dtd">
35
+ <html>
36
+ <head>
37
+ ...
38
+ </head>
39
+ <body>
40
+ ...
41
+ </body>
42
+ </html>
43
+
44
+ The URI used as a system identifier with the public identifier allows
45
+ the user agent to download the DTD and entity sets as needed.
46
+
47
+ The FPI for the Strict HTML 4.01 DTD is:
48
+
49
+ "-//W3C//DTD HTML 4.01//EN"
50
+
51
+ This version of the strict DTD is:
52
+
53
+ http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd
54
+
55
+ Authors should use the Strict DTD unless they need the
56
+ presentation control for user agents that don't (adequately)
57
+ support style sheets.
58
+
59
+ If you are writing a document that includes frames, use
60
+ the following FPI:
61
+
62
+ "-//W3C//DTD HTML 4.01 Frameset//EN"
63
+
64
+ This version of the frameset DTD is:
65
+
66
+ http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
67
+
68
+ Use the following (relative) URIs to refer to
69
+ the DTDs and entity definitions of this specification:
70
+
71
+ "strict.dtd"
72
+ "loose.dtd"
73
+ "frameset.dtd"
74
+ "HTMLlat1.ent"
75
+ "HTMLsymbol.ent"
76
+ "HTMLspecial.ent"
77
+
78
+ -->
79
+
80
+ <!--================== Imported Names ====================================-->
81
+ <!-- Feature Switch for frameset documents -->
82
+ <!ENTITY % HTML.Frameset "IGNORE">
83
+
84
+ <!ENTITY % ContentType "CDATA"
85
+ -- media type, as per [RFC2045]
86
+ -->
87
+
88
+ <!ENTITY % ContentTypes "CDATA"
89
+ -- comma-separated list of media types, as per [RFC2045]
90
+ -->
91
+
92
+ <!ENTITY % Charset "CDATA"
93
+ -- a character encoding, as per [RFC2045]
94
+ -->
95
+
96
+ <!ENTITY % Charsets "CDATA"
97
+ -- a space-separated list of character encodings, as per [RFC2045]
98
+ -->
99
+
100
+ <!ENTITY % LanguageCode "NAME"
101
+ -- a language code, as per [RFC1766]
102
+ -->
103
+
104
+ <!ENTITY % Character "CDATA"
105
+ -- a single character from [ISO10646]
106
+ -->
107
+
108
+ <!ENTITY % LinkTypes "CDATA"
109
+ -- space-separated list of link types
110
+ -->
111
+
112
+ <!ENTITY % MediaDesc "CDATA"
113
+ -- single or comma-separated list of media descriptors
114
+ -->
115
+
116
+ <!ENTITY % URI "CDATA"
117
+ -- a Uniform Resource Identifier,
118
+ see [URI]
119
+ -->
120
+
121
+ <!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
122
+
123
+
124
+ <!ENTITY % Script "CDATA" -- script expression -->
125
+
126
+ <!ENTITY % StyleSheet "CDATA" -- style sheet data -->
127
+
128
+ <!ENTITY % FrameTarget "CDATA" -- render in this frame -->
129
+
130
+
131
+ <!ENTITY % Text "CDATA">
132
+
133
+
134
+ <!-- Parameter Entities -->
135
+
136
+ <!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
137
+
138
+ <!ENTITY % heading "H1|H2|H3|H4|H5|H6">
139
+
140
+ <!ENTITY % list "UL | OL | DIR | MENU">
141
+
142
+ <!ENTITY % preformatted "PRE">
143
+
144
+ <!ENTITY % Color "CDATA" -- a color using sRGB: #RRGGBB as Hex values -->
145
+
146
+ <!-- There are also 16 widely known color names with their sRGB values:
147
+
148
+ Black = #000000 Green = #008000
149
+ Silver = #C0C0C0 Lime = #00FF00
150
+ Gray = #808080 Olive = #808000
151
+ White = #FFFFFF Yellow = #FFFF00
152
+ Maroon = #800000 Navy = #000080
153
+ Red = #FF0000 Blue = #0000FF
154
+ Purple = #800080 Teal = #008080
155
+ Fuchsia= #FF00FF Aqua = #00FFFF
156
+ -->
157
+
158
+ <!ENTITY % bodycolors "
159
+ bgcolor %Color; #IMPLIED -- document background color --
160
+ text %Color; #IMPLIED -- document text color --
161
+ link %Color; #IMPLIED -- color of links --
162
+ vlink %Color; #IMPLIED -- color of visited links --
163
+ alink %Color; #IMPLIED -- color of selected links --
164
+ ">
165
+
166
+ <!--================ Character mnemonic entities =========================-->
167
+
168
+ <!ENTITY % HTMLlat1 PUBLIC
169
+ "-//W3C//ENTITIES Latin1//EN//HTML"
170
+ "HTMLlat1.ent">
171
+ %HTMLlat1;
172
+
173
+ <!ENTITY % HTMLsymbol PUBLIC
174
+ "-//W3C//ENTITIES Symbols//EN//HTML"
175
+ "HTMLsymbol.ent">
176
+ %HTMLsymbol;
177
+
178
+ <!ENTITY % HTMLspecial PUBLIC
179
+ "-//W3C//ENTITIES Special//EN//HTML"
180
+ "HTMLspecial.ent">
181
+ %HTMLspecial;
182
+ <!--=================== Generic Attributes ===============================-->
183
+
184
+ <!ENTITY % coreattrs
185
+ "id ID #IMPLIED -- document-wide unique id --
186
+ class CDATA #IMPLIED -- space-separated list of classes --
187
+ style %StyleSheet; #IMPLIED -- associated style info --
188
+ title %Text; #IMPLIED -- advisory title --"
189
+ >
190
+
191
+ <!ENTITY % i18n
192
+ "lang %LanguageCode; #IMPLIED -- language code --
193
+ dir (ltr|rtl) #IMPLIED -- direction for weak/neutral text --"
194
+ >
195
+
196
+ <!ENTITY % events
197
+ "onclick %Script; #IMPLIED -- a pointer button was clicked --
198
+ ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
199
+ onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
200
+ onmouseup %Script; #IMPLIED -- a pointer button was released --
201
+ onmouseover %Script; #IMPLIED -- a pointer was moved onto --
202
+ onmousemove %Script; #IMPLIED -- a pointer was moved within --
203
+ onmouseout %Script; #IMPLIED -- a pointer was moved away --
204
+ onkeypress %Script; #IMPLIED -- a key was pressed and released --
205
+ onkeydown %Script; #IMPLIED -- a key was pressed down --
206
+ onkeyup %Script; #IMPLIED -- a key was released --"
207
+ >
208
+
209
+ <!-- Reserved Feature Switch -->
210
+ <!ENTITY % HTML.Reserved "IGNORE">
211
+
212
+ <!-- The following attributes are reserved for possible future use -->
213
+ <![ %HTML.Reserved; [
214
+ <!ENTITY % reserved
215
+ "datasrc %URI; #IMPLIED -- a single or tabular Data Source --
216
+ datafld CDATA #IMPLIED -- the property or column name --
217
+ dataformatas (plaintext|html) plaintext -- text or html --"
218
+ >
219
+ ]]>
220
+
221
+ <!ENTITY % reserved "">
222
+
223
+ <!ENTITY % attrs "%coreattrs; %i18n; %events;">
224
+
225
+ <!ENTITY % align "align (left|center|right|justify) #IMPLIED"
226
+ -- default is left for ltr paragraphs, right for rtl --
227
+ >
228
+
229
+ <!--=================== Text Markup ======================================-->
230
+
231
+ <!ENTITY % fontstyle
232
+ "TT | I | B | U | S | STRIKE | BIG | SMALL">
233
+
234
+ <!ENTITY % phrase "EM | STRONG | DFN | CODE |
235
+ SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
236
+
237
+ <!ENTITY % special
238
+ "A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
239
+ MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
240
+
241
+ <!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
242
+
243
+ <!-- %inline; covers inline or "text-level" elements -->
244
+ <!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
245
+
246
+ <!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
247
+ <!ATTLIST (%fontstyle;|%phrase;)
248
+ %attrs; -- %coreattrs, %i18n, %events --
249
+ >
250
+
251
+ <!ELEMENT (SUB|SUP) - - (%inline;)* -- subscript, superscript -->
252
+ <!ATTLIST (SUB|SUP)
253
+ %attrs; -- %coreattrs, %i18n, %events --
254
+ >
255
+
256
+ <!ELEMENT SPAN - - (%inline;)* -- generic language/style container -->
257
+ <!ATTLIST SPAN
258
+ %attrs; -- %coreattrs, %i18n, %events --
259
+ %reserved; -- reserved for possible future use --
260
+ >
261
+
262
+ <!ELEMENT BDO - - (%inline;)* -- I18N BiDi over-ride -->
263
+ <!ATTLIST BDO
264
+ %coreattrs; -- id, class, style, title --
265
+ lang %LanguageCode; #IMPLIED -- language code --
266
+ dir (ltr|rtl) #REQUIRED -- directionality --
267
+ >
268
+
269
+ <!ELEMENT BASEFONT - O EMPTY -- base font size -->
270
+ <!ATTLIST BASEFONT
271
+ id ID #IMPLIED -- document-wide unique id --
272
+ size CDATA #REQUIRED -- base font size for FONT elements --
273
+ color %Color; #IMPLIED -- text color --
274
+ face CDATA #IMPLIED -- comma-separated list of font names --
275
+ >
276
+
277
+ <!ELEMENT FONT - - (%inline;)* -- local change to font -->
278
+ <!ATTLIST FONT
279
+ %coreattrs; -- id, class, style, title --
280
+ %i18n; -- lang, dir --
281
+ size CDATA #IMPLIED -- [+|-]nn e.g. size="+1", size="4" --
282
+ color %Color; #IMPLIED -- text color --
283
+ face CDATA #IMPLIED -- comma-separated list of font names --
284
+ >
285
+
286
+ <!ELEMENT BR - O EMPTY -- forced line break -->
287
+ <!ATTLIST BR
288
+ %coreattrs; -- id, class, style, title --
289
+ clear (left|all|right|none) none -- control of text flow --
290
+ >
291
+
292
+ <!--================== HTML content models ===============================-->
293
+
294
+ <!--
295
+ HTML has two basic content models:
296
+
297
+ %inline; character level elements and text strings
298
+ %block; block-like elements e.g. paragraphs and lists
299
+ -->
300
+
301
+ <!ENTITY % block
302
+ "P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
303
+ NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
304
+ TABLE | FIELDSET | ADDRESS">
305
+
306
+ <!ENTITY % flow "%block; | %inline;">
307
+
308
+ <!--=================== Document Body ====================================-->
309
+
310
+ <!ELEMENT BODY O O (%flow;)* +(INS|DEL) -- document body -->
311
+ <!ATTLIST BODY
312
+ %attrs; -- %coreattrs, %i18n, %events --
313
+ onload %Script; #IMPLIED -- the document has been loaded --
314
+ onunload %Script; #IMPLIED -- the document has been removed --
315
+ background %URI; #IMPLIED -- texture tile for document
316
+ background --
317
+ %bodycolors; -- bgcolor, text, link, vlink, alink --
318
+ >
319
+
320
+ <!ELEMENT ADDRESS - - ((%inline;)|P)* -- information on author -->
321
+ <!ATTLIST ADDRESS
322
+ %attrs; -- %coreattrs, %i18n, %events --
323
+ >
324
+
325
+ <!ELEMENT DIV - - (%flow;)* -- generic language/style container -->
326
+ <!ATTLIST DIV
327
+ %attrs; -- %coreattrs, %i18n, %events --
328
+ %align; -- align, text alignment --
329
+ %reserved; -- reserved for possible future use --
330
+ >
331
+
332
+ <!ELEMENT CENTER - - (%flow;)* -- shorthand for DIV align=center -->
333
+ <!ATTLIST CENTER
334
+ %attrs; -- %coreattrs, %i18n, %events --
335
+ >
336
+
337
+ <!--================== The Anchor Element ================================-->
338
+
339
+ <!ENTITY % Shape "(rect|circle|poly|default)">
340
+ <!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
341
+
342
+ <!ELEMENT A - - (%inline;)* -(A) -- anchor -->
343
+ <!ATTLIST A
344
+ %attrs; -- %coreattrs, %i18n, %events --
345
+ charset %Charset; #IMPLIED -- char encoding of linked resource --
346
+ type %ContentType; #IMPLIED -- advisory content type --
347
+ name CDATA #IMPLIED -- named link end --
348
+ href %URI; #IMPLIED -- URI for linked resource --
349
+ hreflang %LanguageCode; #IMPLIED -- language code --
350
+ target %FrameTarget; #IMPLIED -- render in this frame --
351
+ rel %LinkTypes; #IMPLIED -- forward link types --
352
+ rev %LinkTypes; #IMPLIED -- reverse link types --
353
+ accesskey %Character; #IMPLIED -- accessibility key character --
354
+ shape %Shape; rect -- for use with client-side image maps --
355
+ coords %Coords; #IMPLIED -- for use with client-side image maps --
356
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
357
+ onfocus %Script; #IMPLIED -- the element got the focus --
358
+ onblur %Script; #IMPLIED -- the element lost the focus --
359
+ >
360
+
361
+ <!--================== Client-side image maps ============================-->
362
+
363
+ <!-- These can be placed in the same document or grouped in a
364
+ separate document although this isn't yet widely supported -->
365
+
366
+ <!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
367
+ <!ATTLIST MAP
368
+ %attrs; -- %coreattrs, %i18n, %events --
369
+ name CDATA #REQUIRED -- for reference by usemap --
370
+ >
371
+
372
+ <!ELEMENT AREA - O EMPTY -- client-side image map area -->
373
+ <!ATTLIST AREA
374
+ %attrs; -- %coreattrs, %i18n, %events --
375
+ shape %Shape; rect -- controls interpretation of coords --
376
+ coords %Coords; #IMPLIED -- comma-separated list of lengths --
377
+ href %URI; #IMPLIED -- URI for linked resource --
378
+ target %FrameTarget; #IMPLIED -- render in this frame --
379
+ nohref (nohref) #IMPLIED -- this region has no action --
380
+ alt %Text; #REQUIRED -- short description --
381
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
382
+ accesskey %Character; #IMPLIED -- accessibility key character --
383
+ onfocus %Script; #IMPLIED -- the element got the focus --
384
+ onblur %Script; #IMPLIED -- the element lost the focus --
385
+ >
386
+
387
+ <!--================== The LINK Element ==================================-->
388
+
389
+ <!--
390
+ Relationship values can be used in principle:
391
+
392
+ a) for document specific toolbars/menus when used
393
+ with the LINK element in document head e.g.
394
+ start, contents, previous, next, index, end, help
395
+ b) to link to a separate style sheet (rel=stylesheet)
396
+ c) to make a link to a script (rel=script)
397
+ d) by stylesheets to control how collections of
398
+ html nodes are rendered into printed documents
399
+ e) to make a link to a printable version of this document
400
+ e.g. a postscript or pdf version (rel=alternate media=print)
401
+ -->
402
+
403
+ <!ELEMENT LINK - O EMPTY -- a media-independent link -->
404
+ <!ATTLIST LINK
405
+ %attrs; -- %coreattrs, %i18n, %events --
406
+ charset %Charset; #IMPLIED -- char encoding of linked resource --
407
+ href %URI; #IMPLIED -- URI for linked resource --
408
+ hreflang %LanguageCode; #IMPLIED -- language code --
409
+ type %ContentType; #IMPLIED -- advisory content type --
410
+ rel %LinkTypes; #IMPLIED -- forward link types --
411
+ rev %LinkTypes; #IMPLIED -- reverse link types --
412
+ media %MediaDesc; #IMPLIED -- for rendering on these media --
413
+ target %FrameTarget; #IMPLIED -- render in this frame --
414
+ >
415
+
416
+ <!--=================== Images ===========================================-->
417
+
418
+ <!-- Length defined in strict DTD for cellpadding/cellspacing -->
419
+ <!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
420
+ <!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
421
+
422
+ <![ %HTML.Frameset; [
423
+ <!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
424
+ ]]>
425
+
426
+ <!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
427
+
428
+ <!ENTITY % IAlign "(top|middle|bottom|left|right)" -- center? -->
429
+
430
+ <!-- To avoid problems with text-only UAs as well as
431
+ to make image content understandable and navigable
432
+ to users of non-visual UAs, you need to provide
433
+ a description with ALT, and avoid server-side image maps -->
434
+ <!ELEMENT IMG - O EMPTY -- Embedded image -->
435
+ <!ATTLIST IMG
436
+ %attrs; -- %coreattrs, %i18n, %events --
437
+ src %URI; #REQUIRED -- URI of image to embed --
438
+ alt %Text; #REQUIRED -- short description --
439
+ longdesc %URI; #IMPLIED -- link to long description
440
+ (complements alt) --
441
+ name CDATA #IMPLIED -- name of image for scripting --
442
+ height %Length; #IMPLIED -- override height --
443
+ width %Length; #IMPLIED -- override width --
444
+ usemap %URI; #IMPLIED -- use client-side image map --
445
+ ismap (ismap) #IMPLIED -- use server-side image map --
446
+ align %IAlign; #IMPLIED -- vertical or horizontal alignment --
447
+ border %Pixels; #IMPLIED -- link border width --
448
+ hspace %Pixels; #IMPLIED -- horizontal gutter --
449
+ vspace %Pixels; #IMPLIED -- vertical gutter --
450
+ >
451
+
452
+ <!-- USEMAP points to a MAP element which may be in this document
453
+ or an external document, although the latter is not widely supported -->
454
+
455
+ <!--==================== OBJECT ======================================-->
456
+ <!--
457
+ OBJECT is used to embed objects as part of HTML pages
458
+ PARAM elements should precede other content. SGML mixed content
459
+ model technicality precludes specifying this formally ...
460
+ -->
461
+
462
+ <!ELEMENT OBJECT - - (PARAM | %flow;)*
463
+ -- generic embedded object -->
464
+ <!ATTLIST OBJECT
465
+ %attrs; -- %coreattrs, %i18n, %events --
466
+ declare (declare) #IMPLIED -- declare but don't instantiate flag --
467
+ classid %URI; #IMPLIED -- identifies an implementation --
468
+ codebase %URI; #IMPLIED -- base URI for classid, data, archive--
469
+ data %URI; #IMPLIED -- reference to object's data --
470
+ type %ContentType; #IMPLIED -- content type for data --
471
+ codetype %ContentType; #IMPLIED -- content type for code --
472
+ archive CDATA #IMPLIED -- space-separated list of URIs --
473
+ standby %Text; #IMPLIED -- message to show while loading --
474
+ height %Length; #IMPLIED -- override height --
475
+ width %Length; #IMPLIED -- override width --
476
+ usemap %URI; #IMPLIED -- use client-side image map --
477
+ name CDATA #IMPLIED -- submit as part of form --
478
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
479
+ align %IAlign; #IMPLIED -- vertical or horizontal alignment --
480
+ border %Pixels; #IMPLIED -- link border width --
481
+ hspace %Pixels; #IMPLIED -- horizontal gutter --
482
+ vspace %Pixels; #IMPLIED -- vertical gutter --
483
+ %reserved; -- reserved for possible future use --
484
+ >
485
+
486
+ <!ELEMENT PARAM - O EMPTY -- named property value -->
487
+ <!ATTLIST PARAM
488
+ id ID #IMPLIED -- document-wide unique id --
489
+ name CDATA #REQUIRED -- property name --
490
+ value CDATA #IMPLIED -- property value --
491
+ valuetype (DATA|REF|OBJECT) DATA -- How to interpret value --
492
+ type %ContentType; #IMPLIED -- content type for value
493
+ when valuetype=ref --
494
+ >
495
+
496
+ <!--=================== Java APPLET ==================================-->
497
+ <!--
498
+ One of code or object attributes must be present.
499
+ Place PARAM elements before other content.
500
+ -->
501
+ <!ELEMENT APPLET - - (PARAM | %flow;)* -- Java applet -->
502
+ <!ATTLIST APPLET
503
+ %coreattrs; -- id, class, style, title --
504
+ codebase %URI; #IMPLIED -- optional base URI for applet --
505
+ archive CDATA #IMPLIED -- comma-separated archive list --
506
+ code CDATA #IMPLIED -- applet class file --
507
+ object CDATA #IMPLIED -- serialized applet file --
508
+ alt %Text; #IMPLIED -- short description --
509
+ name CDATA #IMPLIED -- allows applets to find each other --
510
+ width %Length; #REQUIRED -- initial width --
511
+ height %Length; #REQUIRED -- initial height --
512
+ align %IAlign; #IMPLIED -- vertical or horizontal alignment --
513
+ hspace %Pixels; #IMPLIED -- horizontal gutter --
514
+ vspace %Pixels; #IMPLIED -- vertical gutter --
515
+ >
516
+
517
+ <!--=================== Horizontal Rule ==================================-->
518
+
519
+ <!ELEMENT HR - O EMPTY -- horizontal rule -->
520
+ <!ATTLIST HR
521
+ %attrs; -- %coreattrs, %i18n, %events --
522
+ align (left|center|right) #IMPLIED
523
+ noshade (noshade) #IMPLIED
524
+ size %Pixels; #IMPLIED
525
+ width %Length; #IMPLIED
526
+ >
527
+
528
+ <!--=================== Paragraphs =======================================-->
529
+
530
+ <!ELEMENT P - O (%inline;)* -- paragraph -->
531
+ <!ATTLIST P
532
+ %attrs; -- %coreattrs, %i18n, %events --
533
+ %align; -- align, text alignment --
534
+ >
535
+
536
+ <!--=================== Headings =========================================-->
537
+
538
+ <!--
539
+ There are six levels of headings from H1 (the most important)
540
+ to H6 (the least important).
541
+ -->
542
+
543
+ <!ELEMENT (%heading;) - - (%inline;)* -- heading -->
544
+ <!ATTLIST (%heading;)
545
+ %attrs; -- %coreattrs, %i18n, %events --
546
+ %align; -- align, text alignment --
547
+ >
548
+
549
+ <!--=================== Preformatted Text ================================-->
550
+
551
+ <!-- excludes markup for images and changes in font size -->
552
+ <!ENTITY % pre.exclusion "IMG|OBJECT|APPLET|BIG|SMALL|SUB|SUP|FONT|BASEFONT">
553
+
554
+ <!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
555
+ <!ATTLIST PRE
556
+ %attrs; -- %coreattrs, %i18n, %events --
557
+ width NUMBER #IMPLIED
558
+ >
559
+
560
+ <!--===================== Inline Quotes ==================================-->
561
+
562
+ <!ELEMENT Q - - (%inline;)* -- short inline quotation -->
563
+ <!ATTLIST Q
564
+ %attrs; -- %coreattrs, %i18n, %events --
565
+ cite %URI; #IMPLIED -- URI for source document or msg --
566
+ >
567
+
568
+ <!--=================== Block-like Quotes ================================-->
569
+
570
+ <!ELEMENT BLOCKQUOTE - - (%flow;)* -- long quotation -->
571
+ <!ATTLIST BLOCKQUOTE
572
+ %attrs; -- %coreattrs, %i18n, %events --
573
+ cite %URI; #IMPLIED -- URI for source document or msg --
574
+ >
575
+
576
+ <!--=================== Inserted/Deleted Text ============================-->
577
+
578
+
579
+ <!-- INS/DEL are handled by inclusion on BODY -->
580
+ <!ELEMENT (INS|DEL) - - (%flow;)* -- inserted text, deleted text -->
581
+ <!ATTLIST (INS|DEL)
582
+ %attrs; -- %coreattrs, %i18n, %events --
583
+ cite %URI; #IMPLIED -- info on reason for change --
584
+ datetime %Datetime; #IMPLIED -- date and time of change --
585
+ >
586
+
587
+ <!--=================== Lists ============================================-->
588
+
589
+ <!-- definition lists - DT for term, DD for its definition -->
590
+
591
+ <!ELEMENT DL - - (DT|DD)+ -- definition list -->
592
+ <!ATTLIST DL
593
+ %attrs; -- %coreattrs, %i18n, %events --
594
+ compact (compact) #IMPLIED -- reduced interitem spacing --
595
+ >
596
+
597
+ <!ELEMENT DT - O (%inline;)* -- definition term -->
598
+ <!ELEMENT DD - O (%flow;)* -- definition description -->
599
+ <!ATTLIST (DT|DD)
600
+ %attrs; -- %coreattrs, %i18n, %events --
601
+ >
602
+
603
+ <!-- Ordered lists (OL) Numbering style
604
+
605
+ 1 arablic numbers 1, 2, 3, ...
606
+ a lower alpha a, b, c, ...
607
+ A upper alpha A, B, C, ...
608
+ i lower roman i, ii, iii, ...
609
+ I upper roman I, II, III, ...
610
+
611
+ The style is applied to the sequence number which by default
612
+ is reset to 1 for the first list item in an ordered list.
613
+
614
+ This can't be expressed directly in SGML due to case folding.
615
+ -->
616
+
617
+ <!ENTITY % OLStyle "CDATA" -- constrained to: "(1|a|A|i|I)" -->
618
+
619
+ <!ELEMENT OL - - (LI)+ -- ordered list -->
620
+ <!ATTLIST OL
621
+ %attrs; -- %coreattrs, %i18n, %events --
622
+ type %OLStyle; #IMPLIED -- numbering style --
623
+ compact (compact) #IMPLIED -- reduced interitem spacing --
624
+ start NUMBER #IMPLIED -- starting sequence number --
625
+ >
626
+
627
+ <!-- Unordered Lists (UL) bullet styles -->
628
+ <!ENTITY % ULStyle "(disc|square|circle)">
629
+
630
+ <!ELEMENT UL - - (LI)+ -- unordered list -->
631
+ <!ATTLIST UL
632
+ %attrs; -- %coreattrs, %i18n, %events --
633
+ type %ULStyle; #IMPLIED -- bullet style --
634
+ compact (compact) #IMPLIED -- reduced interitem spacing --
635
+ >
636
+
637
+ <!ELEMENT (DIR|MENU) - - (LI)+ -(%block;) -- directory list, menu list -->
638
+ <!ATTLIST DIR
639
+ %attrs; -- %coreattrs, %i18n, %events --
640
+ compact (compact) #IMPLIED -- reduced interitem spacing --
641
+ >
642
+ <!ATTLIST MENU
643
+ %attrs; -- %coreattrs, %i18n, %events --
644
+ compact (compact) #IMPLIED -- reduced interitem spacing --
645
+ >
646
+
647
+ <!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle;|%OLStyle;)" -->
648
+
649
+ <!ELEMENT LI - O (%flow;)* -- list item -->
650
+ <!ATTLIST LI
651
+ %attrs; -- %coreattrs, %i18n, %events --
652
+ type %LIStyle; #IMPLIED -- list item style --
653
+ value NUMBER #IMPLIED -- reset sequence number --
654
+ >
655
+
656
+ <!--================ Forms ===============================================-->
657
+ <!ELEMENT FORM - - (%flow;)* -(FORM) -- interactive form -->
658
+ <!ATTLIST FORM
659
+ %attrs; -- %coreattrs, %i18n, %events --
660
+ action %URI; #REQUIRED -- server-side form handler --
661
+ method (GET|POST) GET -- HTTP method used to submit the form--
662
+ enctype %ContentType; "application/x-www-form-urlencoded"
663
+ accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
664
+ name CDATA #IMPLIED -- name of form for scripting --
665
+ onsubmit %Script; #IMPLIED -- the form was submitted --
666
+ onreset %Script; #IMPLIED -- the form was reset --
667
+ target %FrameTarget; #IMPLIED -- render in this frame --
668
+ accept-charset %Charsets; #IMPLIED -- list of supported charsets --
669
+ >
670
+
671
+ <!-- Each label must not contain more than ONE field -->
672
+ <!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
673
+ <!ATTLIST LABEL
674
+ %attrs; -- %coreattrs, %i18n, %events --
675
+ for IDREF #IMPLIED -- matches field ID value --
676
+ accesskey %Character; #IMPLIED -- accessibility key character --
677
+ onfocus %Script; #IMPLIED -- the element got the focus --
678
+ onblur %Script; #IMPLIED -- the element lost the focus --
679
+ >
680
+
681
+ <!ENTITY % InputType
682
+ "(TEXT | PASSWORD | CHECKBOX |
683
+ RADIO | SUBMIT | RESET |
684
+ FILE | HIDDEN | IMAGE | BUTTON)"
685
+ >
686
+
687
+ <!-- attribute name required for all but submit and reset -->
688
+ <!ELEMENT INPUT - O EMPTY -- form control -->
689
+ <!ATTLIST INPUT
690
+ %attrs; -- %coreattrs, %i18n, %events --
691
+ type %InputType; TEXT -- what kind of widget is needed --
692
+ name CDATA #IMPLIED -- submit as part of form --
693
+ value CDATA #IMPLIED -- Specify for radio buttons and checkboxes --
694
+ checked (checked) #IMPLIED -- for radio buttons and check boxes --
695
+ disabled (disabled) #IMPLIED -- unavailable in this context --
696
+ readonly (readonly) #IMPLIED -- for text and passwd --
697
+ size CDATA #IMPLIED -- specific to each type of field --
698
+ maxlength NUMBER #IMPLIED -- max chars for text fields --
699
+ src %URI; #IMPLIED -- for fields with images --
700
+ alt CDATA #IMPLIED -- short description --
701
+ usemap %URI; #IMPLIED -- use client-side image map --
702
+ ismap (ismap) #IMPLIED -- use server-side image map --
703
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
704
+ accesskey %Character; #IMPLIED -- accessibility key character --
705
+ onfocus %Script; #IMPLIED -- the element got the focus --
706
+ onblur %Script; #IMPLIED -- the element lost the focus --
707
+ onselect %Script; #IMPLIED -- some text was selected --
708
+ onchange %Script; #IMPLIED -- the element value was changed --
709
+ accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
710
+ align %IAlign; #IMPLIED -- vertical or horizontal alignment --
711
+ %reserved; -- reserved for possible future use --
712
+ >
713
+
714
+ <!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
715
+ <!ATTLIST SELECT
716
+ %attrs; -- %coreattrs, %i18n, %events --
717
+ name CDATA #IMPLIED -- field name --
718
+ size NUMBER #IMPLIED -- rows visible --
719
+ multiple (multiple) #IMPLIED -- default is single selection --
720
+ disabled (disabled) #IMPLIED -- unavailable in this context --
721
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
722
+ onfocus %Script; #IMPLIED -- the element got the focus --
723
+ onblur %Script; #IMPLIED -- the element lost the focus --
724
+ onchange %Script; #IMPLIED -- the element value was changed --
725
+ %reserved; -- reserved for possible future use --
726
+ >
727
+
728
+ <!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
729
+ <!ATTLIST OPTGROUP
730
+ %attrs; -- %coreattrs, %i18n, %events --
731
+ disabled (disabled) #IMPLIED -- unavailable in this context --
732
+ label %Text; #REQUIRED -- for use in hierarchical menus --
733
+ >
734
+
735
+ <!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->
736
+ <!ATTLIST OPTION
737
+ %attrs; -- %coreattrs, %i18n, %events --
738
+ selected (selected) #IMPLIED
739
+ disabled (disabled) #IMPLIED -- unavailable in this context --
740
+ label %Text; #IMPLIED -- for use in hierarchical menus --
741
+ value CDATA #IMPLIED -- defaults to element content --
742
+ >
743
+
744
+ <!ELEMENT TEXTAREA - - (#PCDATA) -- multi-line text field -->
745
+ <!ATTLIST TEXTAREA
746
+ %attrs; -- %coreattrs, %i18n, %events --
747
+ name CDATA #IMPLIED
748
+ rows NUMBER #REQUIRED
749
+ cols NUMBER #REQUIRED
750
+ disabled (disabled) #IMPLIED -- unavailable in this context --
751
+ readonly (readonly) #IMPLIED
752
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
753
+ accesskey %Character; #IMPLIED -- accessibility key character --
754
+ onfocus %Script; #IMPLIED -- the element got the focus --
755
+ onblur %Script; #IMPLIED -- the element lost the focus --
756
+ onselect %Script; #IMPLIED -- some text was selected --
757
+ onchange %Script; #IMPLIED -- the element value was changed --
758
+ %reserved; -- reserved for possible future use --
759
+ >
760
+
761
+ <!--
762
+ #PCDATA is to solve the mixed content problem,
763
+ per specification only whitespace is allowed there!
764
+ -->
765
+ <!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
766
+ <!ATTLIST FIELDSET
767
+ %attrs; -- %coreattrs, %i18n, %events --
768
+ >
769
+
770
+ <!ELEMENT LEGEND - - (%inline;)* -- fieldset legend -->
771
+ <!ENTITY % LAlign "(top|bottom|left|right)">
772
+
773
+ <!ATTLIST LEGEND
774
+ %attrs; -- %coreattrs, %i18n, %events --
775
+ accesskey %Character; #IMPLIED -- accessibility key character --
776
+ align %LAlign; #IMPLIED -- relative to fieldset --
777
+ >
778
+
779
+ <!ELEMENT BUTTON - -
780
+ (%flow;)* -(A|%formctrl;|FORM|ISINDEX|FIELDSET|IFRAME)
781
+ -- push button -->
782
+ <!ATTLIST BUTTON
783
+ %attrs; -- %coreattrs, %i18n, %events --
784
+ name CDATA #IMPLIED
785
+ value CDATA #IMPLIED -- sent to server when submitted --
786
+ type (button|submit|reset) submit -- for use as form button --
787
+ disabled (disabled) #IMPLIED -- unavailable in this context --
788
+ tabindex NUMBER #IMPLIED -- position in tabbing order --
789
+ accesskey %Character; #IMPLIED -- accessibility key character --
790
+ onfocus %Script; #IMPLIED -- the element got the focus --
791
+ onblur %Script; #IMPLIED -- the element lost the focus --
792
+ %reserved; -- reserved for possible future use --
793
+ >
794
+
795
+ <!--======================= Tables =======================================-->
796
+
797
+ <!-- IETF HTML table standard, see [RFC1942] -->
798
+
799
+ <!--
800
+ The BORDER attribute sets the thickness of the frame around the
801
+ table. The default units are screen pixels.
802
+
803
+ The FRAME attribute specifies which parts of the frame around
804
+ the table should be rendered. The values are not the same as
805
+ CALS to avoid a name clash with the VALIGN attribute.
806
+
807
+ The value "border" is included for backwards compatibility with
808
+ <TABLE BORDER> which yields frame=border and border=implied
809
+ For <TABLE BORDER=1> you get border=1 and frame=implied. In this
810
+ case, it is appropriate to treat this as frame=border for backwards
811
+ compatibility with deployed browsers.
812
+ -->
813
+ <!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
814
+
815
+ <!--
816
+ The RULES attribute defines which rules to draw between cells:
817
+
818
+ If RULES is absent then assume:
819
+ "none" if BORDER is absent or BORDER=0 otherwise "all"
820
+ -->
821
+
822
+ <!ENTITY % TRules "(none | groups | rows | cols | all)">
823
+
824
+ <!-- horizontal placement of table relative to document -->
825
+ <!ENTITY % TAlign "(left|center|right)">
826
+
827
+ <!-- horizontal alignment attributes for cell contents -->
828
+ <!ENTITY % cellhalign
829
+ "align (left|center|right|justify|char) #IMPLIED
830
+ char %Character; #IMPLIED -- alignment char, e.g. char=':' --
831
+ charoff %Length; #IMPLIED -- offset for alignment char --"
832
+ >
833
+
834
+ <!-- vertical alignment attributes for cell contents -->
835
+ <!ENTITY % cellvalign
836
+ "valign (top|middle|bottom|baseline) #IMPLIED"
837
+ >
838
+
839
+ <!ELEMENT TABLE - -
840
+ (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
841
+ <!ELEMENT CAPTION - - (%inline;)* -- table caption -->
842
+ <!ELEMENT THEAD - O (TR)+ -- table header -->
843
+ <!ELEMENT TFOOT - O (TR)+ -- table footer -->
844
+ <!ELEMENT TBODY O O (TR)+ -- table body -->
845
+ <!ELEMENT COLGROUP - O (COL)* -- table column group -->
846
+ <!ELEMENT COL - O EMPTY -- table column -->
847
+ <!ELEMENT TR - O (TH|TD)+ -- table row -->
848
+ <!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->
849
+
850
+ <!ATTLIST TABLE -- table element --
851
+ %attrs; -- %coreattrs, %i18n, %events --
852
+ summary %Text; #IMPLIED -- purpose/structure for speech output--
853
+ width %Length; #IMPLIED -- table width --
854
+ border %Pixels; #IMPLIED -- controls frame width around table --
855
+ frame %TFrame; #IMPLIED -- which parts of frame to render --
856
+ rules %TRules; #IMPLIED -- rulings between rows and cols --
857
+ cellspacing %Length; #IMPLIED -- spacing between cells --
858
+ cellpadding %Length; #IMPLIED -- spacing within cells --
859
+ align %TAlign; #IMPLIED -- table position relative to window --
860
+ bgcolor %Color; #IMPLIED -- background color for cells --
861
+ %reserved; -- reserved for possible future use --
862
+ datapagesize CDATA #IMPLIED -- reserved for possible future use --
863
+ >
864
+
865
+ <!ENTITY % CAlign "(top|bottom|left|right)">
866
+
867
+ <!ATTLIST CAPTION
868
+ %attrs; -- %coreattrs, %i18n, %events --
869
+ align %CAlign; #IMPLIED -- relative to table --
870
+ >
871
+
872
+ <!--
873
+ COLGROUP groups a set of COL elements. It allows you to group
874
+ several semantically related columns together.
875
+ -->
876
+ <!ATTLIST COLGROUP
877
+ %attrs; -- %coreattrs, %i18n, %events --
878
+ span NUMBER 1 -- default number of columns in group --
879
+ width %MultiLength; #IMPLIED -- default width for enclosed COLs --
880
+ %cellhalign; -- horizontal alignment in cells --
881
+ %cellvalign; -- vertical alignment in cells --
882
+ >
883
+
884
+ <!--
885
+ COL elements define the alignment properties for cells in
886
+ one or more columns.
887
+
888
+ The WIDTH attribute specifies the width of the columns, e.g.
889
+
890
+ width=64 width in screen pixels
891
+ width=0.5* relative width of 0.5
892
+
893
+ The SPAN attribute causes the attributes of one
894
+ COL element to apply to more than one column.
895
+ -->
896
+ <!ATTLIST COL -- column groups and properties --
897
+ %attrs; -- %coreattrs, %i18n, %events --
898
+ span NUMBER 1 -- COL attributes affect N columns --
899
+ width %MultiLength; #IMPLIED -- column width specification --
900
+ %cellhalign; -- horizontal alignment in cells --
901
+ %cellvalign; -- vertical alignment in cells --
902
+ >
903
+
904
+ <!--
905
+ Use THEAD to duplicate headers when breaking table
906
+ across page boundaries, or for static headers when
907
+ TBODY sections are rendered in scrolling panel.
908
+
909
+ Use TFOOT to duplicate footers when breaking table
910
+ across page boundaries, or for static footers when
911
+ TBODY sections are rendered in scrolling panel.
912
+
913
+ Use multiple TBODY sections when rules are needed
914
+ between groups of table rows.
915
+ -->
916
+ <!ATTLIST (THEAD|TBODY|TFOOT) -- table section --
917
+ %attrs; -- %coreattrs, %i18n, %events --
918
+ %cellhalign; -- horizontal alignment in cells --
919
+ %cellvalign; -- vertical alignment in cells --
920
+ >
921
+
922
+ <!ATTLIST TR -- table row --
923
+ %attrs; -- %coreattrs, %i18n, %events --
924
+ %cellhalign; -- horizontal alignment in cells --
925
+ %cellvalign; -- vertical alignment in cells --
926
+ bgcolor %Color; #IMPLIED -- background color for row --
927
+ >
928
+
929
+
930
+ <!-- Scope is simpler than headers attribute for common tables -->
931
+ <!ENTITY % Scope "(row|col|rowgroup|colgroup)">
932
+
933
+ <!-- TH is for headers, TD for data, but for cells acting as both use TD -->
934
+ <!ATTLIST (TH|TD) -- header or data cell --
935
+ %attrs; -- %coreattrs, %i18n, %events --
936
+ abbr %Text; #IMPLIED -- abbreviation for header cell --
937
+ axis CDATA #IMPLIED -- comma-separated list of related headers--
938
+ headers IDREFS #IMPLIED -- list of id's for header cells --
939
+ scope %Scope; #IMPLIED -- scope covered by header cells --
940
+ rowspan NUMBER 1 -- number of rows spanned by cell --
941
+ colspan NUMBER 1 -- number of cols spanned by cell --
942
+ %cellhalign; -- horizontal alignment in cells --
943
+ %cellvalign; -- vertical alignment in cells --
944
+ nowrap (nowrap) #IMPLIED -- suppress word wrap --
945
+ bgcolor %Color; #IMPLIED -- cell background color --
946
+ width %Length; #IMPLIED -- width for cell --
947
+ height %Length; #IMPLIED -- height for cell --
948
+ >
949
+
950
+ <!--================== Document Frames ===================================-->
951
+
952
+ <!--
953
+ The content model for HTML documents depends on whether the HEAD is
954
+ followed by a FRAMESET or BODY element. The widespread omission of
955
+ the BODY start tag makes it impractical to define the content model
956
+ without the use of a marked section.
957
+ -->
958
+
959
+ <![ %HTML.Frameset; [
960
+ <!ELEMENT FRAMESET - - ((FRAMESET|FRAME)+ & NOFRAMES?) -- window subdivision-->
961
+ <!ATTLIST FRAMESET
962
+ %coreattrs; -- id, class, style, title --
963
+ rows %MultiLengths; #IMPLIED -- list of lengths,
964
+ default: 100% (1 row) --
965
+ cols %MultiLengths; #IMPLIED -- list of lengths,
966
+ default: 100% (1 col) --
967
+ onload %Script; #IMPLIED -- all the frames have been loaded --
968
+ onunload %Script; #IMPLIED -- all the frames have been removed --
969
+ >
970
+ ]]>
971
+
972
+ <![ %HTML.Frameset; [
973
+ <!-- reserved frame names start with "_" otherwise starts with letter -->
974
+ <!ELEMENT FRAME - O EMPTY -- subwindow -->
975
+ <!ATTLIST FRAME
976
+ %coreattrs; -- id, class, style, title --
977
+ longdesc %URI; #IMPLIED -- link to long description
978
+ (complements title) --
979
+ name CDATA #IMPLIED -- name of frame for targetting --
980
+ src %URI; #IMPLIED -- source of frame content --
981
+ frameborder (1|0) 1 -- request frame borders? --
982
+ marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
983
+ marginheight %Pixels; #IMPLIED -- margin height in pixels --
984
+ noresize (noresize) #IMPLIED -- allow users to resize frames? --
985
+ scrolling (yes|no|auto) auto -- scrollbar or none --
986
+ >
987
+ ]]>
988
+
989
+ <!ELEMENT IFRAME - - (%flow;)* -- inline subwindow -->
990
+ <!ATTLIST IFRAME
991
+ %coreattrs; -- id, class, style, title --
992
+ longdesc %URI; #IMPLIED -- link to long description
993
+ (complements title) --
994
+ name CDATA #IMPLIED -- name of frame for targetting --
995
+ src %URI; #IMPLIED -- source of frame content --
996
+ frameborder (1|0) 1 -- request frame borders? --
997
+ marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
998
+ marginheight %Pixels; #IMPLIED -- margin height in pixels --
999
+ scrolling (yes|no|auto) auto -- scrollbar or none --
1000
+ align %IAlign; #IMPLIED -- vertical or horizontal alignment --
1001
+ height %Length; #IMPLIED -- frame height --
1002
+ width %Length; #IMPLIED -- frame width --
1003
+ >
1004
+
1005
+ <![ %HTML.Frameset; [
1006
+ <!ENTITY % noframes.content "(BODY) -(NOFRAMES)">
1007
+ ]]>
1008
+
1009
+ <!ENTITY % noframes.content "(%flow;)*">
1010
+
1011
+ <!ELEMENT NOFRAMES - - %noframes.content;
1012
+ -- alternate content container for non frame-based rendering -->
1013
+ <!ATTLIST NOFRAMES
1014
+ %attrs; -- %coreattrs, %i18n, %events --
1015
+ >
1016
+
1017
+ <!--================ Document Head =======================================-->
1018
+ <!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
1019
+ <!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
1020
+
1021
+ <!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
1022
+ <!ATTLIST HEAD
1023
+ %i18n; -- lang, dir --
1024
+ profile %URI; #IMPLIED -- named dictionary of meta info --
1025
+ >
1026
+
1027
+ <!-- The TITLE element is not considered part of the flow of text.
1028
+ It should be displayed, for example as the page header or
1029
+ window title. Exactly one title is required per document.
1030
+ -->
1031
+ <!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
1032
+ <!ATTLIST TITLE %i18n>
1033
+
1034
+ <!ELEMENT ISINDEX - O EMPTY -- single line prompt -->
1035
+ <!ATTLIST ISINDEX
1036
+ %coreattrs; -- id, class, style, title --
1037
+ %i18n; -- lang, dir --
1038
+ prompt %Text; #IMPLIED -- prompt message -->
1039
+
1040
+ <!ELEMENT BASE - O EMPTY -- document base URI -->
1041
+ <!ATTLIST BASE
1042
+ href %URI; #IMPLIED -- URI that acts as base URI --
1043
+ target %FrameTarget; #IMPLIED -- render in this frame --
1044
+ >
1045
+
1046
+ <!ELEMENT META - O EMPTY -- generic metainformation -->
1047
+ <!ATTLIST META
1048
+ %i18n; -- lang, dir, for use with content --
1049
+ http-equiv NAME #IMPLIED -- HTTP response header name --
1050
+ name NAME #IMPLIED -- metainformation name --
1051
+ content CDATA #REQUIRED -- associated information --
1052
+ scheme CDATA #IMPLIED -- select form of content --
1053
+ >
1054
+
1055
+ <!ELEMENT STYLE - - %StyleSheet -- style info -->
1056
+ <!ATTLIST STYLE
1057
+ %i18n; -- lang, dir, for use with title --
1058
+ type %ContentType; #REQUIRED -- content type of style language --
1059
+ media %MediaDesc; #IMPLIED -- designed for use with these media --
1060
+ title %Text; #IMPLIED -- advisory title --
1061
+ >
1062
+
1063
+ <!ELEMENT SCRIPT - - %Script; -- script statements -->
1064
+ <!ATTLIST SCRIPT
1065
+ charset %Charset; #IMPLIED -- char encoding of linked resource --
1066
+ type %ContentType; #REQUIRED -- content type of script language --
1067
+ language CDATA #IMPLIED -- predefined script language name --
1068
+ src %URI; #IMPLIED -- URI for an external script --
1069
+ defer (defer) #IMPLIED -- UA may defer execution of script --
1070
+ event CDATA #IMPLIED -- reserved for possible future use --
1071
+ for %URI; #IMPLIED -- reserved for possible future use --
1072
+ >
1073
+
1074
+ <!ELEMENT NOSCRIPT - - (%flow;)*
1075
+ -- alternate content container for non script-based rendering -->
1076
+ <!ATTLIST NOSCRIPT
1077
+ %attrs; -- %coreattrs, %i18n, %events --
1078
+ >
1079
+
1080
+ <!--================ Document Structure ==================================-->
1081
+ <!ENTITY % version "version CDATA #FIXED '%HTML.Version;'">
1082
+
1083
+ <![ %HTML.Frameset; [
1084
+ <!ENTITY % html.content "HEAD, FRAMESET">
1085
+ ]]>
1086
+
1087
+ <!ENTITY % html.content "HEAD, BODY">
1088
+
1089
+ <!ELEMENT HTML O O (%html.content;) -- document root element -->
1090
+ <!ATTLIST HTML
1091
+ %i18n; -- lang, dir --
1092
+ %version;
1093
+ >