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

Re: "Datatypes" for DTDs


dtd data types
Some comments:

1. Does ESIS output PIs in the DTD?
2. Entities in XML cannot have just a PUBLIC ID, they must also have a 
SYSTEM id.
3. SDATA doesn't exist in XML. Do you mean NDATA?

-Wayne Steele

>From: Arjun Ray <aray@n...>
>To: xml-dev@l...
>Subject: Re:  "Datatypes" for DTDs
>Date: Wed, 02 Oct 2002 05:28:41 +0000
>
>Bob DuCharme <bobdc@s...> wrote:
>
>| All right, here's my trick for datatypes in DTDs [...]
>
>| To summarize: for simple element types, instead of the e-dtype
>| attribute used by DT4DTD, use a #FIXED xsi:type attribute described
>| in section 2.6.1 (http://www.w3.org/TR/xmlschema-1/#xsi_type) of XML
>| Schema Part 1, which is used more widely.
>
>Ugh. :-(
>
>| For attribute typing, I do have parameter entity trick, but I thought
>| it was better than the DT4DTD one.
>
>AFAIK, DT4DTD doesn't use PEs.  This is one of its major virtues.  (Maybe
>you meant that you like the trick itself better?)  Personally, I view any
>method needing PEs to be basically broken.
>
>For completeness, let me outline one version of the external entity hack.
>Assume a declarative mechanism (say, a PI) which identifies the name of a
>distinguished attribute.  For concreteness, let this name be type-map.  It
>will have a declared value of NAMES (NMTOKENS in XML); the names will be
>of other attributes on the same element type.  The first of these names
>will be that of an attribute with declared value ENTITIES, the rest of
>attributes for which data types will be "mapped" by the entities named in
>the first attribute (in a correspondence list fashion).  These entities,
>in turn, are placeholder public identifiers with associated notations, and
>these notations name the data types.  Putting it all together, you have
>something like this (using the example in the DT4DTD note):
>
>    <?xml-typemap typemap ?>
>    <!NOTATION  date
>                PUBLIC "etc etc"
>                >
>    <!ENTITY    date-hook
>                PUBLIC "whatever"
>                SDATA date
>                >
>    <!NOTATION  length
>                PUBLIC "etc etc"
>                >
>    <!ENTITY    length-hook
>                PUBLIC "whatever"
>                SDATA length
>                >
>    <!-- more like above, for all needed data types, and then -->
>    <!ATTLIST   person
>                birthdate  CDATA     #IMPLIED
>                binding    CDATA     #IMPLIED
>                typemap    NMTOKENS  #FIXED  "foo birthdate binding"
>                foo        ENTITIES  #FIXED  "date-hook length-hook"
>                >
>
>Note that the typemap value will usually have one more name than the foo
>"hook" to datatypes.  If the foo attribute has the same number, then the
>first is the hook for the element type itself.  IOW, something like this
>
>    <!ATTLIST   birthdate
>                typemap   NMTOKENS   #FIXED   "foo"
>                foo       ENTITIES   #FIXED   "date-hook"
>                >
>
>would mean that the data type applied to the #PCDATA content.
>
>Note that even something as "old-fashioned" as the ESIS output of nsgmls
>will report all the needed notations.
>
>A similar hack is possible with LPDs too.
>



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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.