OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Empty elements

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <ak117@freenet.carleton.ca>
  • To: xml-dev@ic.ac.uk
  • 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:

   <IMG align="left"
    src="http://www.w3.org/Icons/WWW/w3c_home" />
   <br></br>
   <br/>

Here's the definition of "for interoperability":

   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

  <br></br>

and

  <br/>

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

-- 
David Megginson                 ak117@freenet.carleton.ca
Microstar Software Ltd.         dmeggins@microstar.com
      http://home.sprynet.com/sprynet/dmeggins/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS