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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: SGML and XML

[ Lists Home | Date Index | Thread Index ]
  • From: Clark Evans <clark.evans@manhattanproject.com>
  • To: Kevin Hsu <shyutz@ms1.hinet.net>
  • Date: Tue, 30 Mar 1999 18:56:29 +0000

Kevin Hsu wrote:
> 
> Hi,
> 
> I know the XML is the subset of SGML , and SGML is more complex and detail ,
> but I must write a paper to tell the difference,
> who can tell me the major difference between the SGML and XML, or where can
> I find information , thanks in advance!

I hope this will help:

-------- Original Message --------
Subject: Advantages of XML and SGML
Date: Fri, 12 Feb 1999 20:28:33 +0000
From: Clark Evans <clark.evans@manhattanproject.com>
Reply-To: Clark Evans <clark.evans@manhattanproject.com>
To: xml-dev@ic.ac.uk
Cc: Susan Barron <susan.d.barron@lmco.com>

Susan Barron wrote:
> 
> We have been using SGML for several years and are closely watching the
> trend towards XML.  Could someone please give me some examples of why
> you would use XML over SGML.  I know that XML is a subset of SGML.  I
> believe there must be some things that can be done in SGML that are not
> possible in XML.  Conversely, there must be somethings that XML does
> better than SGML. Thank you.


Since minimization is allowed in SGML, this creates situations
where the meaning of document can have multiple syntatic interpretations.
For instance:

<parent>
   <child>

Can have two syntatic intererpretations:

<parent>
   <child>
   </child>
</parent>

OR

<parent>
</parent>
<child>
</child>

The DTD is required for the parser to figure out which one is 
the correct interpretation of the input.   As such, an SGML
document must have one_and_only_one DTD to resolve these 
syntatic ambiguities.

XML restricts the syntax by eliminating these minimizations.
Thus, all documents have one and only one syntatic interpretation.
This dramatically reduces the complexity of the parser. Thus, a 
parser can be simpler to implement, and a DTD is _not_ required 
for parsing.

This lets the DTD be used for a 100% semantic role, which
is much more interesting for describing data!  This is great
beacuse it allows a document to conform to more than
one DTD at the same time, _without_ requiring a "mother"
DTD that merges all of the DTD's together.    This is
called "Architectures".   It allows multiple meanings
for the same document, depending upon the observer
without requireing all of the possible observers
to get together and specify a "united" DTD.  

However, this added flexibility, comes at a price:
The syntax becomes much more restrictive.

Therefore,

  For computer program <=> computer program
  communication XML is the ideal structure to use.
  Since it allows multiple subscribers to have
  their own interpretation of a data stream without
  changing the publishers.

  For human => computer communication SGML is will
  probably still remain as the prefered structure.
  The minimization features are very valueable 
  when a human is the author of the document.
  
  Also, there is nothing saying you can't use both!

  If a human is going to write it by hand, perhaps
  SGML is better, then you can have JClark's SP
  use the DTD to resolve the ambiguities and produce
  the XML document that can be introduced into the
  corporate "xml bus"

Hope this helps!

Clark Evans

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/ and on CD-ROM/ISBN 981-02-3594-1
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)


  • References:



 

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

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