SAX: Whitespace Handling (question 5 of 10)

Paul Prescod papresco at
Sun Jan 4 02:16:03 GMT 1998

David Megginson wrote:
> [SAX is a proposal for a simple, event-based XML API, using
> callbacks.  This is one in a series of ten design questions that we
> need to answer to implement the API.]
> Should SAX allow DTD-driven parsers to distinguish ignorable
> whitespace from other character data?
>   public void ignorableWhitespace (char ch[], int length);
> - the concept of ignorable whitespace can be confusing for
>   non-specialists.

You've mentioned this a few times, but I wonder if we are really making
a spec. for people who are not familiar with XML itself. Ignorable
whitespace is an unfortunate fact of life (and entities are a fortunate
fact of life) and people who want to work with XML parsers should be
familiar with XML concepts. All we should hide from them is the nitty
gritty syntax.
> Tim Bray's recent comments on this list imply that a validating parser
> using SAX could report ignorable whitespace as regular character data
> and still be conforming; if I have inferred correctly, then I am
> willing to omit this callback.

Could someone please show me where the spec. provides leeway for this
sort of thing? If SAX is meant to be usable with validating parsers
(e.g. parsers which report validation errors), then I feel that it
should support ignorable whitespace. On the other hand, if it is only
interested in the well-formedness level, then of course this is
 Paul Prescod

Art is always at peril in universities, where there are so many people, 
young and old, who love art less than argument, and dote upon a text 
that provides the nutritious pemmican on which scholars love to chew. 
				-- Robertson Davies in "The Cunning Man"

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list