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

"Datatypes" for DTDs


datatypes in dtds
"Wayne Steele" <xmlmaster@h...> wrote:
|From: Sam Hunting <shunting@e...>
|> [Wayne Steele <xmlmaster@h...>]

|>> One trick that people have used for ages to indicate data types in  
|>> DTDs is through parameter entities. [...] This works great for human 
|>> documentation, but is not especially machine processable.

Right.  Mnemonic PE names have always been a form of handwaving. :-)

|>> I wonder if it's worth more thought to try and bless a way of doing 
|>> this, to provide more meaning to attributes?

Depends on how.  One method is already standardized: the DATA declared
value.  See K.4.4.2 and K.4.4.3 in

 http://www.ornl.gov/sgml/sc34/document/0029.htm

(which as it happens, can work with DTDs already using the PE placeholder
kludge by simply redefining the replacement text of the PEs!)

|> One way is at http://www.w3.org/TR/dt4dtd ("Datatypes for DTDs (DT4DTD) 1.0").
| 
| I'm familiar with DT4DTD, and I think it's a great piece of work.

It's nice as a workaround for deficient syntax, but there are problems
with it (not the least of which is that a workaround would be dubious when
a standardized syntax already exists.)

One is hardwiring names like "e-dtype" and "a-dtype" into what is supposed
to be a generic mechanism.  Also needed is a mechanism to *declare* the
names with such associative semantics - IOW, a generic processor shouldn't
have to care about the particular names as long as it can find out what to
look for, without any possibility of clashing with the application's names
(or to put it another way, why should an application be prevented from
using names like e-dtype and a-dtype for its own purposes when it *also*
wants to use this facility?  It's a first principle of the formalism that
applications be free to choose their own names.) 

Another is that only one associative attribute suffices if its declared
value is going to be CDATA - use a reserved word like #CONTENT (or even
#PCDATA!) as the proxy name of the unnamed attribute, text content, in the
list of pairs in the a-dtype attribute.  This is sort of analogous to an
extension of DATA declared value syntax:

  <!ATTLIST  foo
             #PCDATA  DATA  bar  #IMPLIED
             >

A third is environmental - there's an assumption that an application has
access to declarative information "after the fact".  Interfaces like ESIS,
for example, will not report unreferenced notations, and are silent on
whether an application can query for them.  There is a hack available to
"pull in" notation declaration information as part of the parsing process,
using placeholder external entity declarations, but this increases the
overhead and really ruins the simplicity of the original idea, IMHO!

Lobby for the DATA declared value.  It solves the problem directly.


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.