[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: OSS vs W3C? was: Next Round

  • From: John Cowan <cowan@l...>
  • To: XML Dev <xml-dev@i...>
  • Date: Thu, 21 Jan 1999 15:30:01 -0500

int32 vs int64
A correspondent asked me privately to say more about the
designed uses of XML notations that makes 'em worth having.

> Your comment here intrigues me, though I'm not sure exactly what
> you're saying. Can you say more?

Let's say that you have an element with #PCDATA content that's
supposed to contain a date, like this:

	<CREATED>1999-01-21</CREATED>

You can say that this is a date in a standard way by adding the
following to the DTD:

	<!NOTATION ISO-8601-date SYSTEM "http://www.iso.ch/8601">
	<!ATTLIST CREATED
		type NOTATION(ISO-8601-date) #FIXED "ISO-8601-date">

which says that all CREATED elements have an attribute named "type",
of type NOTATION, with fixed value "ISO-8601-date", which is a
notation bound to the ISO 8601 definition of a date.  This notation
is verbose because there's flexibility in it which I'm not really
exercising, to have elements whose content can be one of multiple
datatypes, like:

	<!NOTATION int32 SYSTEM "...">
	<!NOTATION int64 SYSTEM "....">
	<!NOTATION float SYSTEM "......">
	<!ATTLIST MUTABLE
		type NOTATION(int32,int64,float) #REQUIRED>

which declares that MUTABLE elements must have a "type" attribute
whose value is either "int32" or "int64" or "float", and the notation
declarations tell you what those mean.  The systemids are
URLs that point to the definition of the datatype (in English or
whatever language natural or formalized).

Of course, applications need not be able to fetch the definition and
parse it; they only need to be able to recognize the specific
systemid or publicid that means "ISO 8601 date".  It is implementors
who should be able to fetch the definition and implement in
conformance to it (thus learning that "nnnn-nn-nn" is yyyy-mm-dd).

Similarly, when you want to have a non-XML object referenced from
XML, you use an ENTITY attribute whose value is the name of an
external entity that refers to a notation that in turn refers to the
definition of the format of the external entity.  (Read twice, slowly
:-)).  My DTD fragment http://www.ccil.org/~cowan/XML/media-types.dtd
declares notations that refer to the definitions of MIME types.

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@c...
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.