Whitespace

David G. Durand dgd at cs.bu.edu
Tue Aug 26 16:26:36 BST 1997


At 7:39 AM -0500 8/26/97, Peter Murray-Rust wrote:
>Actually I would like to develop CML *without* its own set of rules as far
>as possible. OK, Only chemists want to know how to display <ATOMS>, but
>there is just as much material of the form:
><P> We took
><VAR TYPE="float">23.03+e02</VAR>
><UNIT>gram</UNIT>
>of water
></P>
>and we want to know whether there is whitespace round the contained elements.
>As I have repeatedly said I would like to borrow a communal solution rather
>than invent yet another one.
But there is whitespace around the contained elements. If you don't want
it, don't put it in...

XML passes all whitespace in the source to the application.

<P> We took <VAR TYPE="float">23.03+e02</VAR><UNIT>gram</UNIT> of water</P>

has no space. An Author can be told to enter either one, depending on what
they want. If you want the effect of my markup with the source you gave,
that's a CML convention, to the effect that VAR and UNIT "eat" adjacent
whitespace...

or a formatting convention.

The worst problem I see with whitespace is one that can't be solved by a
parser easily:

if I have a document bit like:

This is an end of paragraph.</P><p>And this is the start of another.

There's no way to tell that there isn't a word "paragraph.And" in the
document, without knowing the meaning of the tags. Of course there is only
one word in:

<font size=+5>L</font>arge initial letter

But this tends to bear out my view that whitespace handling is just the tip
of an iceberg only soluble with a lot of semantic knowledge -- that it is
the duty of stylesheet and DTD authors to determine.


_________________________________________
David Durand              dgd at cs.bu.edu  \  david at dynamicDiagrams.com
Boston University Computer Science        \  Sr. Analyst
http://www.cs.bu.edu/students/grads/dgd/   \  Dynamic Diagrams
--------------------------------------------\  http://dynamicDiagrams.com/
MAPA: mapping for the WWW                    \__________________________



xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa at ic.ac.uk)




More information about the Xml-dev mailing list