Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/port80/html/tidy/TagTable.java


1   /*
2    * @(#)TagTable.java   1.11 2000/08/16
3    *
4    */
5   
6   package com.port80.html.tidy;
7   
8   /**
9    *
10   * Tag dictionary node hash table
11   *
12   * (c) 1998-2000 (W3C) MIT, INRIA, Keio University
13   * See Tidy.java for the copyright notice.
14   * Derived from <a href="http://www.w3.org/People/Raggett/tidy">
15   * HTML Tidy Release 4 Aug 2000</a>
16   *
17   * @author  Dave Raggett <dsr@w3.org>
18   * @author  Andy Quick <ac.quick@sympatico.ca> (translation to Java)
19   * @version 1.0, 1999/05/22
20   * @version 1.0.1, 1999/05/29
21   * @version 1.1, 1999/06/18 Java Bean
22   * @version 1.2, 1999/07/10 Tidy Release 7 Jul 1999
23   * @version 1.3, 1999/07/30 Tidy Release 26 Jul 1999
24   * @version 1.4, 1999/09/04 DOM support
25   * @version 1.5, 1999/10/23 Tidy Release 27 Sep 1999
26   * @version 1.6, 1999/11/01 Tidy Release 22 Oct 1999
27   * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
28   * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
29   * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
30   * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
31   * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
32   * Modified from a Singleton to a non-Singleton.
33   */
34  
35  import java.util.HashMap;
36  import java.util.Hashtable;
37  import java.util.Map;
38  
39  public class TagTable {
40  
41    ////////////////////////////////////////////////////////////////////////                                
42  
43    private static Dict[] tags =
44      {
45        new Dict(
46          "html",
47          (short) (Dict.VERS_ALL | Dict.VERS_FRAMES),
48          (Dict.CM_HTML | Dict.CM_OPT | Dict.CM_OMITST),
49          ParserImpl.getParseHTML(),
50          CheckAttribsImpl.getCheckHTML()),
51        new Dict(
52          "head",
53          (short) (Dict.VERS_ALL | Dict.VERS_FRAMES),
54          (Dict.CM_HTML | Dict.CM_OPT | Dict.CM_OMITST),
55          ParserImpl.getParseHead(),
56          null),
57        new Dict(
58          "title",
59          (short) (Dict.VERS_ALL | Dict.VERS_FRAMES),
60          Dict.CM_HEAD,
61          ParserImpl.getParseTitle(),
62          null),
63        new Dict(
64          "base",
65          (short) (Dict.VERS_ALL | Dict.VERS_FRAMES),
66          (Dict.CM_HEAD | Dict.CM_EMPTY),
67          null,
68          null),
69        new Dict(
70          "link",
71          (short) (Dict.VERS_ALL | Dict.VERS_FRAMES),
72          (Dict.CM_HEAD | Dict.CM_EMPTY),
73          null,
74          CheckAttribsImpl.getCheckLINK()),
75        new Dict(
76          "meta",
77          (short) (Dict.VERS_ALL | Dict.VERS_FRAMES),
78          (Dict.CM_HEAD | Dict.CM_EMPTY),
79          null,
80          null),
81        new Dict(
82          "style",
83          (short) (Dict.VERS_FROM32 | Dict.VERS_FRAMES),
84          Dict.CM_HEAD,
85          ParserImpl.getParseScript(),
86          CheckAttribsImpl.getCheckSTYLE()),
87        new Dict(
88          "script",
89          (short) (Dict.VERS_FROM32 | Dict.VERS_FRAMES),
90          (Dict.CM_HEAD | Dict.CM_MIXED | Dict.CM_BLOCK | Dict.CM_INLINE),
91          ParserImpl.getParseScript(),
92          CheckAttribsImpl.getCheckSCRIPT()),
93        new Dict(
94          "server",
95          Dict.VERS_NETSCAPE,
96          (Dict.CM_HEAD | Dict.CM_MIXED | Dict.CM_BLOCK | Dict.CM_INLINE),
97          ParserImpl.getParseScript(),
98          null),
99        new Dict(
100         "body",
101         Dict.VERS_ALL,
102         (Dict.CM_HTML | Dict.CM_OPT | Dict.CM_OMITST),
103         ParserImpl.getParseBody(),
104         null),
105       new Dict(
106         "frameset",
107         Dict.VERS_FRAMES,
108         (Dict.CM_HTML | Dict.CM_FRAMES),
109         ParserImpl.getParseFrameSet(),
110         null),
111       new Dict("p", Dict.VERS_ALL, (Dict.CM_BLOCK | Dict.CM_OPT), ParserImpl.getParseBlock(), null),
112       new Dict(
113         "h1",
114         Dict.VERS_ALL,
115         (Dict.CM_BLOCK | Dict.CM_HEADING),
116         ParserImpl.getParseInline(),
117         null),
118       new Dict(
119         "h2",
120         Dict.VERS_ALL,
121         (Dict.CM_BLOCK | Dict.CM_HEADING),
122         ParserImpl.getParseInline(),
123         null),
124       new Dict(
125         "h3",
126         Dict.VERS_ALL,
127         (Dict.CM_BLOCK | Dict.CM_HEADING),
128         ParserImpl.getParseInline(),
129         null),
130       new Dict(
131         "h4",
132         Dict.VERS_ALL,
133         (Dict.CM_BLOCK | Dict.CM_HEADING),
134         ParserImpl.getParseInline(),
135         null),
136       new Dict(
137         "h5",
138         Dict.VERS_ALL,
139         (Dict.CM_BLOCK | Dict.CM_HEADING),
140         ParserImpl.getParseInline(),
141         null),
142       new Dict(
143         "h6",
144         Dict.VERS_ALL,
145         (Dict.CM_BLOCK | Dict.CM_HEADING),
146         ParserImpl.getParseInline(),
147         null),
148       new Dict("ul", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParseList(), null),
149       new Dict("ol", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParseList(), null),
150       new Dict("dl", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParseDefList(), null),
151       new Dict(
152         "dir",
153         Dict.VERS_LOOSE,
154         (Dict.CM_BLOCK | Dict.CM_OBSOLETE),
155         ParserImpl.getParseList(),
156         null),
157       new Dict(
158         "menu",
159         Dict.VERS_LOOSE,
160         (Dict.CM_BLOCK | Dict.CM_OBSOLETE),
161         ParserImpl.getParseList(),
162         null),
163       new Dict("pre", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParsePre(), null),
164       new Dict(
165         "listing",
166         Dict.VERS_ALL,
167         (Dict.CM_BLOCK | Dict.CM_OBSOLETE),
168         ParserImpl.getParsePre(),
169         null),
170       new Dict(
171         "xmp",
172         Dict.VERS_ALL,
173         (Dict.CM_BLOCK | Dict.CM_OBSOLETE),
174         ParserImpl.getParsePre(),
175         null),
176       new Dict(
177         "plaintext",
178         Dict.VERS_ALL,
179         (Dict.CM_BLOCK | Dict.CM_OBSOLETE),
180         ParserImpl.getParsePre(),
181         null),
182       new Dict("address", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
183       new Dict("blockquote", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
184       new Dict("form", Dict.VERS_ALL, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
185       new Dict("isindex", Dict.VERS_LOOSE, (Dict.CM_BLOCK | Dict.CM_EMPTY), null, null),
186       new Dict("fieldset", Dict.VERS_HTML40, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
187       new Dict(
188         "table",
189         Dict.VERS_FROM32,
190         Dict.CM_BLOCK,
191         ParserImpl.getParseTableTag(),
192         CheckAttribsImpl.getCheckTABLE()),
193       new Dict("div", Dict.VERS_FROM32, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
194       new Dict("multicol", Dict.VERS_NETSCAPE, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
195       new Dict("nosave", Dict.VERS_NETSCAPE, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
196       new Dict("layer", Dict.VERS_NETSCAPE, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
197       new Dict("ilayer", Dict.VERS_NETSCAPE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
198       new Dict(
199         "nolayer",
200         Dict.VERS_NETSCAPE,
201         (Dict.CM_BLOCK | Dict.CM_INLINE | Dict.CM_MIXED),
202         ParserImpl.getParseBlock(),
203         null),
204       new Dict("align", Dict.VERS_NETSCAPE, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
205       new Dict("center", Dict.VERS_LOOSE, Dict.CM_BLOCK, ParserImpl.getParseBlock(), null),
206       new Dict(
207         "ins",
208         Dict.VERS_HTML40,
209         (Dict.CM_INLINE | Dict.CM_BLOCK | Dict.CM_MIXED),
210         ParserImpl.getParseInline(),
211         null),
212       new Dict(
213         "del",
214         Dict.VERS_HTML40,
215         (Dict.CM_INLINE | Dict.CM_BLOCK | Dict.CM_MIXED),
216         ParserImpl.getParseInline(),
217         null),
218       new Dict(
219         "li",
220         Dict.VERS_ALL,
221         (Dict.CM_LIST | Dict.CM_OPT | Dict.FM_SMART_INDENT),
222         ParserImpl.getParseBlock(),
223         null),
224       new Dict(
225         "dt",
226         Dict.VERS_ALL,
227         (Dict.CM_DEFLIST | Dict.CM_OPT | Dict.FM_SMART_INDENT),
228         ParserImpl.getParseInline(),
229         null),
230       new Dict(
231         "dd",
232         Dict.VERS_ALL,
233         (Dict.CM_DEFLIST | Dict.CM_OPT | Dict.FM_SMART_INDENT),
234         ParserImpl.getParseBlock(),
235         null),
236       new Dict(
237         "caption",
238         Dict.VERS_FROM32,
239         Dict.CM_TABLE,
240         ParserImpl.getParseInline(),
241         CheckAttribsImpl.getCheckCaption()),
242       new Dict(
243         "colgroup",
244         Dict.VERS_HTML40,
245         (Dict.CM_TABLE | Dict.CM_OPT),
246         ParserImpl.getParseColGroup(),
247         null),
248       new Dict("col", Dict.VERS_HTML40, (Dict.CM_TABLE | Dict.CM_EMPTY), null, null),
249       new Dict(
250         "thead",
251         Dict.VERS_HTML40,
252         (Dict.CM_TABLE | Dict.CM_ROWGRP | Dict.CM_OPT),
253         ParserImpl.getParseRowGroup(),
254         null),
255       new Dict(
256         "tfoot",
257         Dict.VERS_HTML40,
258         (Dict.CM_TABLE | Dict.CM_ROWGRP | Dict.CM_OPT),
259         ParserImpl.getParseRowGroup(),
260         null),
261       new Dict(
262         "tbody",
263         Dict.VERS_HTML40,
264         (Dict.CM_TABLE | Dict.CM_ROWGRP | Dict.CM_OPT),
265         ParserImpl.getParseRowGroup(),
266         null),
267       new Dict("tr", Dict.VERS_FROM32, (Dict.CM_TABLE | Dict.CM_OPT), ParserImpl.getParseRow(), null),
268       new Dict(
269         "td",
270         Dict.VERS_FROM32,
271         (Dict.CM_ROW | Dict.CM_OPT | Dict.FM_SMART_INDENT),
272         ParserImpl.getParseBlock(),
273         CheckAttribsImpl.getCheckTableCell()),
274       new Dict(
275         "th",
276         Dict.VERS_FROM32,
277         (Dict.CM_ROW | Dict.CM_OPT | Dict.FM_SMART_INDENT),
278         ParserImpl.getParseBlock(),
279         CheckAttribsImpl.getCheckTableCell()),
280       new Dict("q", Dict.VERS_HTML40, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
281     // A tag is INLINE so that simple links are formatted as one liner.
282     // However, content of the A tag are parsed as BLOCK otherwise
283     // parseInline() would terminate the A tag whenever there are BLOCK
284     // type element in the A tag's content.
285     new Dict(
286       "a",
287       Dict.VERS_ALL,
288       (Dict.FM_SOFT_BREAK | Dict.CM_INLINE),
289       ParserImpl.getParseInline(),
290       CheckAttribsImpl.getCheckAnchor()),
291       new Dict(
292         "br",
293         Dict.VERS_ALL,
294         (Dict.FM_HARD_BREAK | Dict.CM_INLINE | Dict.CM_EMPTY),
295         null,
296         null),
297       new Dict(
298         "hr",
299         Dict.VERS_ALL,
300         (Dict.FM_HARD_BREAK | Dict.CM_INLINE | Dict.CM_EMPTY),
301         null,
302         CheckAttribsImpl.getCheckHR()),
303       new Dict(
304         "img",
305         Dict.VERS_ALL,
306         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_IMG | Dict.CM_EMPTY),
307         null,
308         CheckAttribsImpl.getCheckIMG()),
309       new Dict(
310         "object",
311         Dict.VERS_HTML40,
312         (Dict.CM_OBJECT | Dict.CM_HEAD | Dict.CM_IMG | Dict.CM_INLINE | Dict.CM_PARAM),
313         ParserImpl.getParseBlock(),
314         null),
315       new Dict(
316         "applet",
317         Dict.VERS_LOOSE,
318         (Dict.CM_OBJECT | Dict.CM_IMG | Dict.CM_INLINE | Dict.CM_PARAM),
319         ParserImpl.getParseBlock(),
320         null),
321       new Dict(
322         "servlet",
323         Dict.VERS_SUN,
324         (Dict.CM_OBJECT | Dict.CM_IMG | Dict.CM_INLINE | Dict.CM_PARAM),
325         ParserImpl.getParseBlock(),
326         null),
327       new Dict(
328         "param",
329         Dict.VERS_FROM32,
330         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_EMPTY),
331         null,
332         null),
333       new Dict(
334         "embed",
335         Dict.VERS_NETSCAPE,
336         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_IMG | Dict.CM_EMPTY),
337         null,
338         null),
339       new Dict("noembed", Dict.VERS_NETSCAPE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
340       new Dict("iframe", Dict.VERS_HTML40_LOOSE, Dict.CM_INLINE, ParserImpl.getParseBlock(), null),
341       new Dict("frame", Dict.VERS_FRAMES, (Dict.CM_FRAMES | Dict.CM_EMPTY), null, null),
342       new Dict(
343         "noframes",
344         Dict.VERS_IFRAMES,
345         (Dict.CM_BLOCK | Dict.CM_FRAMES),
346         ParserImpl.getParseNoFrames(),
347         null),
348       new Dict(
349         "noscript",
350         (short) (Dict.VERS_FRAMES | Dict.VERS_HTML40),
351         (Dict.CM_BLOCK | Dict.CM_INLINE | Dict.CM_MIXED),
352         ParserImpl.getParseBlock(),
353         null),
354       new Dict("b", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
355       new Dict("i", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
356       new Dict("u", Dict.VERS_LOOSE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
357       new Dict("tt", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
358       new Dict("s", Dict.VERS_LOOSE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
359       new Dict("strike", Dict.VERS_LOOSE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
360       new Dict("big", Dict.VERS_FROM32, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
361       new Dict("small", Dict.VERS_FROM32, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
362       new Dict("sub", Dict.VERS_FROM32, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
363       new Dict("sup", Dict.VERS_FROM32, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
364       new Dict("em", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
365       new Dict("strong", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
366       new Dict("dfn", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
367       new Dict("code", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
368       new Dict("samp", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
369       new Dict("kbd", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
370       new Dict("var", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
371       new Dict("cite", Dict.VERS_ALL, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
372       new Dict("abbr", Dict.VERS_HTML40, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
373       new Dict("acronym", Dict.VERS_HTML40, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
374       new Dict("span", Dict.VERS_FROM32, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
375       new Dict("blink", Dict.VERS_PROPRIETARY, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
376       new Dict("nobr", Dict.VERS_PROPRIETARY, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
377       new Dict("wbr", Dict.VERS_PROPRIETARY, (Dict.CM_INLINE | Dict.CM_EMPTY), null, null),
378       new Dict(
379         "marquee",
380         Dict.VERS_MICROSOFT,
381         (Dict.CM_INLINE | Dict.CM_OPT),
382         ParserImpl.getParseInline(),
383         null),
384       new Dict("bgsound", Dict.VERS_MICROSOFT, (Dict.CM_HEAD | Dict.CM_EMPTY), null, null),
385       new Dict("comment", Dict.VERS_MICROSOFT, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
386       new Dict("spacer", Dict.VERS_NETSCAPE, (Dict.CM_INLINE | Dict.CM_EMPTY), null, null),
387       new Dict("keygen", Dict.VERS_NETSCAPE, (Dict.CM_INLINE | Dict.CM_EMPTY), null, null),
388       new Dict(
389         "nolayer",
390         Dict.VERS_NETSCAPE,
391         (Dict.CM_BLOCK | Dict.CM_INLINE | Dict.CM_MIXED),
392         ParserImpl.getParseBlock(),
393         null),
394       new Dict("ilayer", Dict.VERS_NETSCAPE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
395       new Dict(
396         "map",
397         Dict.VERS_FROM32,
398         Dict.CM_INLINE,
399         ParserImpl.getParseBlock(),
400         CheckAttribsImpl.getCheckMap()),
401       new Dict(
402         "area",
403         Dict.VERS_ALL,
404         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_EMPTY),
405         null,
406         CheckAttribsImpl.getCheckAREA()),
407       new Dict(
408         "input",
409         Dict.VERS_ALL,
410         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_IMG | Dict.CM_EMPTY),
411         null,
412         null),
413       new Dict(
414         "select",
415         Dict.VERS_ALL,
416         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_FIELD),
417         ParserImpl.getParseSelect(),
418         null),
419       new Dict(
420         "option",
421         Dict.VERS_ALL,
422         (Dict.CM_FIELD | Dict.CM_OPT),
423         ParserImpl.getParseText(),
424         null),
425       new Dict(
426         "optgroup",
427         Dict.VERS_HTML40,
428         (Dict.CM_FIELD | Dict.CM_OPT),
429         ParserImpl.getParseOptGroup(),
430         null),
431       new Dict(
432         "textarea",
433         Dict.VERS_ALL,
434         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE | Dict.CM_FIELD),
435         ParserImpl.getParseText(),
436         null),
437       new Dict("label", Dict.VERS_HTML40, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
438       new Dict("legend", Dict.VERS_HTML40, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
439       new Dict(
440         "button",
441         Dict.VERS_HTML40,
442         (Dict.FM_SOFT_BREAK | Dict.CM_INLINE),
443         ParserImpl.getParseInline(),
444         null),
445       new Dict("basefont", Dict.VERS_LOOSE, (Dict.CM_INLINE | Dict.CM_EMPTY), null, null),
446       new Dict("font", Dict.VERS_LOOSE, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
447       new Dict("bdo", Dict.VERS_HTML40, Dict.CM_INLINE, ParserImpl.getParseInline(), null),
448       };
449 
450   public static final Map INLINE_TAGS = new HashMap();
451   public static final Map EMPTY_TAGS = new HashMap();
452   static {
453     Dict dict;
454     for (int i = 0; i < tags.length; ++i) {
455       dict = tags[i];
456       if ((dict.model & (Dict.CM_INLINE | Dict.FM_SMART_INDENT)) != 0)
457         INLINE_TAGS.put(dict.name, dict);
458       if ((dict.model & Dict.CM_EMPTY) != 0)
459         EMPTY_TAGS.put(dict.name, dict);
460     }
461   }
462 
463   ////////////////////////////////////////////////////////////////////////                                
464 
465   /* create dummy entry for all xml tags */
466   public Dict xmlTags = new Dict(null, Dict.VERS_ALL, (Dict.CM_BLOCK), ParserImpl.getParseBlock(), null);
467 
468   public Dict tagHtml = null;
469   public Dict tagHead = null;
470   public Dict tagBody = null;
471   public Dict tagFrameset = null;
472   public Dict tagFrame = null;
473   public Dict tagNoframes = null;
474   public Dict tagMeta = null;
475   public Dict tagTitle = null;
476   public Dict tagBase = null;
477   public Dict tagHr = null;
478   public Dict tagPre = null;
479   public Dict tagListing = null;
480   public Dict tagH1 = null;
481   public Dict tagH2 = null;
482   public Dict tagP = null;
483   public Dict tagUl = null;
484   public Dict tagOl = null;
485   public Dict tagDir = null;
486   public Dict tagLi = null;
487   public Dict tagDt = null;
488   public Dict tagDd = null;
489   public Dict tagDl = null;
490   public Dict tagTd = null;
491   public Dict tagTh = null;
492   public Dict tagTr = null;
493   public Dict tagCol = null;
494   public Dict tagBr = null;
495   public Dict tagA = null;
496   public Dict tagLink = null;
497   public Dict tagB = null;
498   public Dict tagI = null;
499   public Dict tagStrong = null;
500   public Dict tagEm = null;
501   public Dict tagBig = null;
502   public Dict tagSmall = null;
503   public Dict tagParam = null;
504   public Dict tagOption = null;
505   public Dict tagOptgroup = null;
506   public Dict tagImg = null;
507   public Dict tagMap = null;
508   public Dict tagArea = null;
509   public Dict tagNobr = null;
510   public Dict tagWbr = null;
511   public Dict tagFont = null;
512   public Dict tagSpacer = null;
513   public Dict tagLayer = null;
514   public Dict tagCenter = null;
515   public Dict tagStyle = null;
516   public Dict tagScript = null;
517   public Dict tagNoscript = null;
518   public Dict tagTable = null;
519   public Dict tagCaption = null;
520   public Dict tagForm = null;
521   public Dict tagTextarea = null;
522   public Dict tagBlockquote = null;
523   public Dict tagApplet = null;
524   public Dict tagObject = null;
525   public Dict tagDiv = null;
526   public Dict tagSpan = null;
527 
528   private Hashtable tagHashtable = new Hashtable();
529   private boolean isXML;
530 
531   ////////////////////////////////////////////////////////////////////////                                
532 
533   public TagTable() {
534     for (int i = 0; i < tags.length; i++) {
535       install(tags[i]);
536     }
537     tagHtml = lookup("html");
538     tagHead = lookup("head");
539     tagBody = lookup("body");
540     tagFrameset = lookup("frameset");
541     tagFrame = lookup("frame");
542     tagNoframes = lookup("noframes");
543     tagMeta = lookup("meta");
544     tagTitle = lookup("title");
545     tagBase = lookup("base");
546     tagHr = lookup("hr");
547     tagPre = lookup("pre");
548     tagListing = lookup("listing");
549     tagH1 = lookup("h1");
550     tagH2 = lookup("h2");
551     tagP = lookup("p");
552     tagUl = lookup("ul");
553     tagOl = lookup("ol");
554     tagDir = lookup("dir");
555     tagLi = lookup("li");
556     tagDt = lookup("dt");
557     tagDd = lookup("dd");
558     tagDl = lookup("dl");
559     tagTd = lookup("td");
560     tagTh = lookup("th");
561     tagTr = lookup("tr");
562     tagCol = lookup("col");
563     tagBr = lookup("br");
564     tagA = lookup("a");
565     tagLink = lookup("link");
566     tagB = lookup("b");
567     tagI = lookup("i");
568     tagStrong = lookup("strong");
569     tagEm = lookup("em");
570     tagBig = lookup("big");
571     tagSmall = lookup("small");
572     tagParam = lookup("param");
573     tagOption = lookup("option");
574     tagOptgroup = lookup("optgroup");
575     tagImg = lookup("img");
576     tagMap = lookup("map");
577     tagArea = lookup("area");
578     tagNobr = lookup("nobr");
579     tagWbr = lookup("wbr");
580     tagFont = lookup("font");
581     tagSpacer = lookup("spacer");
582     tagLayer = lookup("layer");
583     tagCenter = lookup("center");
584     tagStyle = lookup("style");
585     tagScript = lookup("script");
586     tagNoscript = lookup("noscript");
587     tagTable = lookup("table");
588     tagCaption = lookup("caption");
589     tagForm = lookup("form");
590     tagTextarea = lookup("textarea");
591     tagBlockquote = lookup("blockquote");
592     tagApplet = lookup("applet");
593     tagObject = lookup("object");
594     tagDiv = lookup("div");
595     tagSpan = lookup("span");
596   }
597 
598   ////////////////////////////////////////////////////////////////////////                                
599 
600   public void setXML(boolean yes) {
601     isXML = yes;
602   }
603 
604   public Dict lookup(String name) {
605     return (Dict) tagHashtable.get(name);
606   }
607 
608   public Dict install(Dict dict) {
609     Dict d = (Dict) tagHashtable.get(dict.name);
610     if (d != null) {
611       d.versions = dict.versions;
612       d.model |= dict.model;
613       d.parser = dict.parser;
614       d.chkattrs = dict.chkattrs;
615       return d;
616     } else {
617       tagHashtable.put(dict.name, dict);
618       return dict;
619     }
620   }
621 
622   /* public interface for finding tag by name */
623   public boolean findTag(Node node) {
624     Dict np;
625     if (node.element != null) {
626       np = lookup(node.element);
627       if (np != null) {
628         node.tag = np;
629         return true;
630       }
631     }
632     if (isXML) {
633       node.tag = xmlTags;
634       return true;
635     }
636     return false;
637   }
638 
639   public Parser findParser(Node node) {
640     Dict np;
641 
642     if (node.element != null) {
643       np = lookup(node.element);
644       if (np != null) {
645         return np.parser;
646       }
647     }
648 
649     return null;
650   }
651 
652   public void defineInlineTag(String name) {
653     install(
654       new Dict(
655         name,
656         Dict.VERS_PROPRIETARY,
657         (Dict.CM_INLINE | Dict.FM_SMART_INDENT | Dict.CM_NEW),
658         ParserImpl.getParseBlock(),
659         null));
660   }
661 
662   public void defineBlockTag(String name) {
663     install(
664       new Dict(
665         name,
666         Dict.VERS_PROPRIETARY,
667         (Dict.CM_BLOCK | Dict.FM_SMART_INDENT | Dict.CM_NEW),
668         ParserImpl.getParseBlock(),
669         null));
670   }
671 
672   public void defineEmptyTag(String name) {
673     install(
674       new Dict(
675         name,
676         Dict.VERS_PROPRIETARY,
677         (Dict.CM_EMPTY | Dict.FM_SMART_INDENT | Dict.CM_NEW),
678         ParserImpl.getParseBlock(),
679         null));
680   }
681 
682   public void definePreTag(String name) {
683     install(
684       new Dict(
685         name,
686         Dict.VERS_PROPRIETARY,
687         (Dict.CM_BLOCK | Dict.FM_SMART_INDENT | Dict.CM_NEW),
688         ParserImpl.getParsePre(),
689         null));
690   }
691 
692   ////////////////////////////////////////////////////////////////////////                                
693 
694 }