Re: [xml] How is ignorableWhitespace defined?

On Mon, Sep 03, 2001 at 08:01:25PM +0200, Jonas Borgström wrote:

How is ignorableWhitespace in SAX defined?

  HTMLparser.c line 1749

static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
    int i;
    xmlNodePtr lastChild;

    for (i = 0;i < len;i++)
        if (!(IS_BLANK(str[i]))) return(0);

    if (CUR == 0) return(1);
    if (CUR != '<') return(0);
    if (ctxt->name == NULL)
    if (xmlStrEqual(ctxt->name, BAD_CAST"html"))
    if (xmlStrEqual(ctxt->name, BAD_CAST"head"))
    if (xmlStrEqual(ctxt->name, BAD_CAST"body"))

  your text is child from body, hence the result.
Should html-browsers (gtkhtml2 in this case) also render
text from the sax->ignoreableWhitespace callback?

  in general no, but HTML rendering having no defined meaning
in terms of SAX it's up to you to decide.

mozilla and konqueror renders space between "FOO" and "BAR".

  doesn't help me at all, if you told me *WHY* they do so then
I may make some progress.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]