|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: SAX and ignorableWhitespace
>> 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








