Re: structure

> Use "HText_registerElementCallback" can
> get all elements' attributes.
> use "HText_registerTextCallback" can get text.
>
> Can I use these two callback functions to build
> a structure of document, like Amaya's Structure View shows?
> or I can build the structure with another better method?
>
    Yes, you can do that.

    The only drawback is that the current HTML parser "eats" some end-tags.

    Basically for all the tags that have the attribute SGML_EMPTY (see
HTMLPDTD.c/HTMLPDTD.h),
    the end tag callback is never called.

    And some of them are currently declared "EMPTY" to avoid stack overflow
in the HTML parser
    (basically all the tags where the end tag is optional - i.e. <P>, <TR>,
<TD>)

    I have some code that in some way adds support for the optional end tag
(i.e. close <P> before
    opening any paragraph-type tag, close <TD> before opening another one
and such, but I need to
    clean it up a bit before checking that in.

-- Raffaele

Received on Friday, 2 July 1999 11:03:17 UTC