Reporting empty elements

David Megginson ak117 at
Wed Jan 7 02:01:30 GMT 1998

Peter Murray-Rust writes:

 > There has been discussion on this and my understanding that the
 > unequivocal policy is that <TAG></TAG> and <TAG/> result in exactly
 > the same events or grove and there is NO way of distinguishing
 > which the original document contained. Some people regret this, but
 > the decision is clear.

One problem is that the PR does not fully define the information set
that an XML parser is required to return to an application (there a
few scattered rules, such as the ignorable-whitespace rule).  I'd
suggest that the difference between <TAG></TAG> and <TAG/> is lexical
rather than structural; an interface like SAX, that operates mainly on
logical structure, should not report the difference; an interface that
preserves lexical features (such as comments, internal entity
references, etc.) might provide access to the original form.

All the best,


David Megginson                 ak117 at
Microstar Software Ltd.         dmeggins at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list