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

Re: [xml] How is ignorableWhitespace defined?



On Mon, Sep 03, 2001 at 08:01:25PM +0200, Jonas Borgström wrote:
> Hi, 
> 
> 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)
        return(1);
    if (xmlStrEqual(ctxt->name, BAD_CAST"html"))
        return(1);
    if (xmlStrEqual(ctxt->name, BAD_CAST"head"))
        return(1);
    if (xmlStrEqual(ctxt->name, BAD_CAST"body"))
        return(1);
    [...]
------

  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.

> PS.
> 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

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




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