[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: SAX and ignorableWhitespace


sax ignore whitespace
>> The word "ignorable" is an
>> unfortunate choice here. It means the application receiving the data
>> may choose to ignore it. However, the parser cannot ignore this
>> content. It must provide it.

>I am willing to take that on faith, but just for the sake of throroughness,
>my question is more "why must it provide it". It seems that the same
>argument could be made for element and attribute declarations. Clearly the
>parser cannot ignore them, yet it is not required that the information be
>passed in one of the default interfaces-- they are only reported through the
>DeclHandler, an extension interface.

We must be quite clear here: it is the whitespace characters that
*must* be provided, not the fact that they are ignorable.  Only
validating parsers have to report that.

A non-validating parser is free to return ignorable whitespace using the
characters() callback instead, even in the presence of a DTD.

But a validating parser must report the fact that it's ignorable, and
SAX chose to report ignorableness by using a different callback.  If
that callback wasn't part of ContentHandler, you would have the
slightly strange situation that which interface reported the
characters would be different depending on whether you used a
validating parser.

>IIRC, the SAX interface set predates the Infoset spec, so any mandate to
>provide specific information to the application must have come from
>somewhere else.

As you observe, it's the XML spec that requires this.  The Infoset does
not place any requirements on what must be reported, just a terminology
for how to describe it.

-- Richard

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.