OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] SAX and ignorableWhitespace

[ Lists Home | Date Index | Thread Index ]

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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS