Lists Home |
Date Index |
- From: David Megginson <email@example.com>
- To: firstname.lastname@example.org
- Date: Thu, 12 Feb 1998 06:36:21 -0800
Jani Jaakkola writes:
> Yes, but in SGML and XML element type which has been declared empty
> in the DTD and therefore is marked with <Para/> tag in XML
> is different thing from element which just happens to be
> empty (e.g <para></para>).
Actually, that's not generally the case in XML. Here's what the REC
says (Section 3.1 "Start-Tags, End-Tags, and Empty-Element Tags"):
Empty-element tags may be used for any element which has no content,
whether or not it is declared using the keyword EMPTY. For
interoperability, the empty-element tag must be used, and can only be
used, for elements which are declared EMPTY.
Examples of empty elements:
Here's the definition of "for interoperability":
A non-binding recommendation included to increase the chances
that XML documents can be processed by the existing installed
base of SGML processors which predate the WebSGML Adaptations
Annex to ISO 8879.
In other words, XML processors may (and should) treat
as equivalent, but document authors might want to make the distinction
so that pre-WebSGML SGML parsers can handle their documents.
That begs the question of the processor's information set, however --
a processor designed for use with repositories or with editors, for
example, needs to preserve lexical as well as structural information
about the XML document, such as comments, general entity references
(even within attribute values), specified vs. defaulted attribute
values, CDATA sections, whitespace within tags, etc.
SAX as it currently stands is not designed to preserve most lexical
information; in the future, we may devise a SAX level-2 to return this
information, but since most applications that need it will probably
use a DOM anyway, the demand may not be strong enough.
All the best,
David Megginson email@example.com
Microstar Software Ltd. firstname.lastname@example.org
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)