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: Wed, 9 Jun 1999 07:57:36 -0700
Message-ID: <008801beb288$705704c0$303728ce@aromatic.com>
To: "Vaclav Barta" <vbar@comp.cz>, "wwwlib" <www-lib@w3.org>
> Ah, thanks. Now, if I understand it correctly, parameters
> "present" and "value" in HText_beginElement are arrays. Their
> size varies with element number. If I want to iterate over
> them (I'm trying to build an "HTML butcher", filtering out parts
> of HTML I don't like), I should have a table with number of
> attributes for every element and iterate over "present" array -
> where present[i] is true, value[i] is valid. Right?
>
    Yes. And you can get the right number of attributes for every tag
    from the HTML/SGML parser. I don't have the sources handy
    but if you check SGML.h there are methods you can call to
    quey the number of attributes for every tag, the right name for the
attributes and such.

    So, the only thing you need is a list of tags and attributes you support
    and you can match them against the values of present and value.

    I'm not sure now, but you may want to check the behaviour of an
attribute
    that is present but has no value (i.e. <TABLE BORDER> ). It could be
    that present[HTML_TABLE_BORDER] is TRUE, but value[HTML_TABLE_BORDER] is
NULL.
    And in this case you want to consider the BORDER attribute as present,
with a default value.

have fun,

    Raffaele
Received on Wednesday, 9 June 1999 10:55:36 GMT

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