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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: X-Schema

[ Lists Home | Date Index | Thread Index ]
  • From: Paul Prescod <paul@prescod.net>
  • To: "XML Developers' List" <xml-dev@ic.ac.uk>
  • Date: Sun, 27 Jun 1999 17:27:06 -0400

"Hunter, David" wrote:
> 
> Don't get me wrong, I happen to like Schemas much better than DTDs, and the
> data typing alone makes them a better choice for many things.  I'm just
> wondering if we wouldn't be better off adding the extra functionality to
> DTDs, instead of creating a new language.  Are there technical reasons why
> we can't?  (Does it have something to do with SGML compatibility?  If so I'd
> be willing to shut up right now.  :-)

There are two major features that DTDs lack:

 * namespace support

 * some built-in form of subtyping

There is also the politically much more important feature of using XML
instance syntax.

Data types can be built as a convention on top of DTDs. That is, in part,
the point of XML's notation feature.

From: http://www.sgmlsource.com/ISOstds.PDF

<!NOTATION ISOdate SYSTEM "url of ISO date handler">
<!NOTATION ISOtime SYSTEM "url of ISO time handler">

<!ELEMENT record (date, time %record-stuff;)>

<!ELEMENT date (#PCDATA)>
<!ATTLIST date e-dtype NOTATION (ISOdate)#FIXED "ISOdate">

<!ELEMENT time (#PCDATA)>
<!ATTLIST time e-dtype NOTATION (ISOtime)#FIXED "ISOtime">

<record>
<date>17 November 1998</date>
<time>0543Z</time>
...
</record>

<!NOTATION ISOdate SYSTEM "url of ISO date handler">
<!NOTATION ISOtime SYSTEM "url of ISO time handler">
<!ELEMENT chapter (%chapter-stuff;)>
<!ATTLIST chapter a-dtypes CDATA #FIXED "date ISOdate time ISOtime"
	date CDATA #IMPLIED
	time CDATA #IMPLIED
>
<chapter date="17 November 1998" time="0543Z">

--

Recently SGML was also extended to do data types more directly:

<!ELEMENT chapter (%chapter-stuff;)>
<!ATTLIST chapter
date DATA regexp [model="[0-9]+-[0-9]+]" max="7"]#IMPLIED
>
<chapter date="12-97">


-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

Perhaps the war in Kosovo would get more press if it were directed by
George Lucas.

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