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

Re: SAX: Whitespace Handling (question 5 of 10)

  • From: "Matthew Gertner" <matthewg@p...>
  • To: "Tim Bray" <tbray@t...>, <xml-dev@i...>
  • Date: Mon, 5 Jan 1998 11:33:15 +0100

sax whitespace text
>At 01:02 PM 03/01/98 -0500, David Megginson wrote:
>>Should SAX allow DTD-driven parsers to distinguish ignorable
>>whitespace from other character data?
>
>If you want to do this, the only reasonable way is with another
>argument on the charData() callback, so that it's always chardata,
>but some processors will in some circumstances signal that it's
>also ignorable.
>
>Since I think it would be highly unwise for any SAX-using
>application to have behavior dependent on the ignorability of
>some white space, I would argue strongly just for leaving
>this out. -Tim


I am pretty leery of arguments along the line of "if we allow this, people
will abuse it". There are certainly cases where this information is
essential, so why lock out certain classes of applications for what
essentially amounts to a single boolean parameter, which could be defaulted?
For example, consider an application that takes an HTML document augmented
with XML tags which are to be converted to text or HTML by some mechanism
for viewing in a HTML browser. If the document reads something like:

...
<body>
First line.
<myprint value="foo">
    <param name="name1" value="value1"/>
</myprint>
Second line.
</body>
...

I am sure there are plenty of similar examples when one DTD is being used to
generate another, viewable one. This is a perfect SAX application since it
doesn't require any funky comments, entity resolution, etc., but if there is
no indication of which whitespace is ignorable, it is impossible to
implement since you get spurious carriage returns and spaces in the
generated output.

BTW: IMHO, IFF there is going to be a "default implementation" anyway, I
would actually prefer an "ignorableWhitespace" method which calls charData
by default. This will permit cleaner implementations.

<ignorance>
Is text containing *only* whitespace inside an "ambiguous" area of a mixed
content model considered to be ignorable?
</ignorance>

Regards,

Matthew
------------------------------------------------
Matthew Gertner
Project Manager/Architect, Internet/Document Management
POET Software GmbH
Tel: +49 (40) 609 90254
Fax: +49 (40) 609 90115
E-mail: matthewg@p...
------------------------------------------------


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.