Re: [xml] ignorableWhitespace SAX callback



On Tue, Jun 29, 2004 at 09:22:47AM +0100, Chris Burdess wrote:
Hello,

Given a document without a DTD, libxml2 reports whitespace characters
via the ignorableWhitespace SAX callback. However, as Daniel notes in

  http://mail.gnome.org/archives/xml/2004-April/msg00244.html

if there is no DTD, you cannot determine that any whitespace is
ignorable. I have discussed this issue with Elliotte Rusty Harold, who

  Well there is the xml:space information too.

is of the opinion that in such cases all whitespace should be reported
via the characters callback. The SAX documentation is not very explicit
on this issue. What is the libxml2 position?

  I think Eliotte is right, but it's like an extremist position, libxml2
fallbacks to an heuristic in that case, but I think in most cases
it will use the character() callback. See areBlanks() in parser.c .
IMHO legal blanks before and after the document root content should be
reported as ignorable, at least those contradict Eliotte position.

If this has been discussed before on the mailing list please excuse me -
the search function is 404 atm so I've relied on Google.

  there is a search on xmlsoft.org which does work and do index the
mail archives.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
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]