W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1999

Re: Params of HTML element callbacks

From: Raffaele Sena <raff@nuvomedia.com>
Date: Tue, 8 Jun 1999 11:28:58 -0700
Message-ID: <008101beb1dc$c5e51a00$52c0a8c0@nuvomedia.com>
To: "Vaclav Barta" <vbar@comp.cz>, "wwwlib" <www-lib@w3.org>

> documentation of HTML element callbacks (functions of type
> HText_beginElement and HText_endElement, registered by
> HText_registerElementCallback) says that "the element
> number and attribute number are integers that are defined by
> the HTML DTD used by the HTMl [sic] parser". What does that
> mean - how do I find out that 40 is <HEAD>, 12 <BODY> etc.?
> I can't find it anywhere in wwwlib headers - is it part of
> HTML definition?
> 
    the HTML DTD (or better, its internal representation)
    is contained in the 2 files: HTMLPDTD.c and HTMLPDTD.h.

    Basically all the tags have the form of HTML_<TAG>
    and the attributes have the form of HTML_<TAG>_<ATTRIBUTE>.

    So, <HEAD> will be defined as HTML_HEAD, <BODY> as HTML_BODY
    and <BODY BACKGROUND=xx> will be HTML_BODY_BACKGROUND.

    Note that the definitions for attributes (in HTMLPDTD.h) 
    is in the form of:

        HTML_ATTR(BODY, BACKGROUND)

    this will generate the appropriate definition for HTML_BODY_BACKGROUND
    in HTMLPDTD.h and "BACKGROUND" in HTMLPDTD.c (I added the macros so 
    the attributes can be copied and pasted between the two files, since
    they need to be kept in sync).

Regards,

    Raffaele
    
Received on Tuesday, 8 June 1999 14:28:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:29 GMT