W3C home > Mailing lists > Public > w3c-sgml-wg@w3.org > May 1997

Re: Whitespace

From: Peter Murray-Rust <Peter@ursus.demon.co.uk>
Date: Wed, 07 May 1997 17:43:45 GMT
Message-Id: <6302@ursus.demon.co.uk>
To: w3c-sgml-wg@w3.org
I now gather that the WG/ERB spent much time on this topic last year and
I wouldn't wish to go over old ground.  However, the present spec is not
clear enough (esp 2.8) and until it's clarified, I think that different
client-side 'systems' will actually give different results.  

The output of the parser depends on whether it 'does read the DTD'.  I'm not
clear whether this means that it:
	- reads a complete DTD (e.g. every element and attribute that may
		occur is defined in the DTD, whether internal/external or
		both)
	- reads the DTD *and* is asked to validate the document
	- reads whatever fragment of the DTD is there (perhaps only a single
		element with content model).
I get the impression that the current parsers do this on a per-element
basis, i.e. if an ELEMENT is present for FOO, then see if it has mixed content
or element content (regardless of other declarations)

For element content the parser 'MAY' pass whitespace to the application,
[but the rest of the sentence is not WF :-).]  This means that different
parsers are allowed to generate different results.  This makes it very 
difficult to write conforming applications, which should be parser-independent
IMO.

The XML-SPACE attribure can presumably be applied on a document-wide
basis (through the DTD) or on a per-element basis.  For example I could
write
<CML XML-SPACE="DEFAULT">
<XLIST XML-SPACE="PRESERVE">
<XVAR>foo</XVAR>
</XLIST>
<XLIST XML-SPACE="DEFAULT">
<XVAR>bar</XVAR>
</XLIST>
</CML>

I struggled with the XML-SPACE semantics - am I right that:
	- XML-SPACE can be used in either WF or valid documents
	- the values are DEFAULT, PRESERVE or #IMPLIED
	- there is no default.  #IMPLIED leads to undefined behaviour.
	- DEFAULT action is outside of the control of the author of the
		document and author of the DTD
	- DEFAULT can be processed on a per-element basis which could vary
		in different contexts, and from DTD to DTD and from
		'application'  to 'application'

I do not understand the string 'unless this attribute is provided or
*defaulted* with PRESERVE'.  This implies that the default (which is not
defined in the box) is not DEFAULT, but PRESERVE.

Does the inheritance of the XML-SPACE attribute value extend recursively?

As you can see I find it difficult to implement, and feel that there are
several places where implementers may deliberately diverge and others
where they may accidentally diverge.  So, assuming that this solution is
the most workable, it needs spelling out in more detail for people like me.

	P.

-- 
Peter Murray-Rust, domestic net connection
Virtual School of Molecular Sciences
http://www.vsms.nottingham.ac.uk/
Received on Wednesday, 7 May 1997 13:10:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:26 UTC