[xml] How is ignorableWhitespace defined?



Hi, 

How is ignorableWhitespace in SAX defined?

If I feed the html document below to "./testHTML jborg.html"

<html>
<body>
<span>FOO</span>        <span>BAR</span>
</body>
</html>

It outputs this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd";>
<html><body>
<span>FOO</span><span>BAR</span>
</body></html>

As you see, the eight spaces between "FOO" and "BAR" are gone.

and "./testHTML --sax jborg.html" gives the following output?

SAX.setDocumentLocator()
SAX.startDocument()
SAX.startElement(html)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(body)
SAX.ignorableWhitespace(
, 1)
SAX.startElement(span)
SAX.characters(FOO, 3)
SAX.endElement(span)
SAX.ignorableWhitespace(        , 8)
SAX.startElement(span)
SAX.characters(BAR, 3)
SAX.endElement(span)
SAX.ignorableWhitespace(
, 1)
SAX.endElement(body)
SAX.ignorableWhitespace(
, 1)
SAX.endElement(html)
SAX.endDocument()

Then we see that the eight spaces are interpreted as
"ignorableWhitespace". So my question is:

Should html-browsers (gtkhtml2 in this case) also render
text from the sax->ignoreableWhitespace callback?

/Jonas

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

-- 
Jonas Borgström                  jonas codefactory se
CodeFactory AB                   http://www.codefactory.se/
Office: +46 (0)90 71 86 10       Cell: +46 (0)70 248 89 58





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