Re: Whitespace

At 06:55 PM 5/7/97 CDT, Michael Sperberg-McQueen wrote:
>On Wed, 7 May 1997 06:41:14 -0400 Peter Murray-Rust said:
>>This is doubtless not news to any of you, but it's a shock to me, that
>>WF documents and validated documents ***GIVE DIFFERENT OUTPUT***.  I
>>am sure that this will be a rich source of confusion.
>
>Yes, it will.  What may not be obvious is that despite that confusion,
>this behavior really was the best available at the time.

Actually, it's worse than Peter thinks.  There are at least three ways
in which DTD-less and DTD-ful processing can produce different 
results:

 1. White space in element content
 2. Default attributes
 3. Attribute values that are space/case normalized only if you
    read the DTD and know they are NMTOKEN or ID or something.

Actually, I don't find #1, the issue that got Peter going, is all
that severe.  I think that addressing into documents based on counting
nodes, without checking their type, or even that they *are* real nodes,
is inherently non-portable and shouldn't be done, unless you *know*
the doc is read-only.  ID's, or element types, or attribute values,
are a much better way to go.  Yes, I appreciate that for maneuvring
through read-only docs, node-counting is sometimes de-rigeur (although
I'd think that in something like CML you could at least count
nodes of particular types) - in the case where counting children is
absolutely necessary, such a count is going to have to be qualified
as DTD-ful or DTD-less, to be sure.

On the other hand, James has suggested just bagging the pseudo-element
thing entirely.  On the one hand this would be painful, but I suspect
you have a better understanding now of why he's saying this. -T.

Received on Wednesday, 7 May 1997 20:59:36 UTC