5 - Check if the (HTML) DOM tree has a <base href="<base-uri>"> element that
8 - Handle optional end tags.
10 - The parser and scanner needs to know about the various data concepts of SGML
11 like CDATA. It could be the start of DOCTYPE definitions. A generic way to
12 create SGML parsers. One obvious place where CDATA would be useful is needed
13 is for <script>#text</script> skipping which currently will generate elements
14 for [ '<' <ident> ] sequences.
16 [Excepts from a mail from Apr 18 15:11 2004 to Witold Filipczyk]
17 -------------------------------------------------------------------------------
18 > AFAIK when <p> is not closed current code doesn't handle such situation. I'm
19 > thinking about function "close_tag" which automagically "closes" tags.
21 The problem with closing tags is to figure out if the end tag is optional. This
22 information is already available in the sgml_node_info structure via the
23 SGML_ELEMENT_END_OPTIONAL flag and the sgml_node_info is then part of the
24 sgml_parser_state structure that is available in the dom_navigator_state's data
27 When initializating the dom navigator it get's passed an object size which it
28 uses for allocating this kind of private data.
30 If you look at add_sgml_element() you will see that it does:
32 struct dom_navigator_state *state;
33 struct sgml_parser_state *pstate;
35 state = get_dom_navigator_top(navigator);
36 assert(node == state->node && state->data);
39 pstate->info = get_sgml_node_info(parser->info->elements, node);
40 node->data.element.type = pstate->info->type;
42 Meaning it sets up the sgml_parser state.
44 Only problem is that I haven't had time to write patches so that the parser
45 actually uses the state info. It is available as:
47 struct sgml_parser_state *pstate = get_dom_navigator_top(navigator)->data;
49 and then when another element should be generated we just have to check if the
50 top requires an end tag meaning
52 if (pstate->info->flags & SGML_ELEMENT_END_OPTIONAL)
54 in which case we need to pop_dom_node(navigator) ..
56 It sounds easy dunno if I have forgotten something. Atleast that is a start and
57 we could maybe do more clever things. But my goal is to make the parser handle
58 fairly clean tag soup well. Later we can maybe put in some hooks to improve
60 -------------------------------------------------------------------------------