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

RE: Conditional statements in DTD?

  • From: "Michael Kay" <mike@s...>
  • To: "'C. M. Sperberg-McQueen'" <cmsmcq@a...>,"'xml-dev'" <xml-dev@l...>
  • Date: Tue, 24 Mar 2009 09:08:46 -0000

RE:  Conditional statements in DTD?
> The view taken in the design of DTDs is essentially that if 
> one element can legitimately have a 'playing' attribute and 
> another element cannot legitimately have a 'playing' 
> attribute, then they appear not to be of the same type.  So 
> give them different names.

> This view seems not so different, to me, from the database 
> analysis discipline that says if some Xs have attribute Y, 
> and other Xs do NOT have attribute Y, you should consider the 
> possibility that you are using the name X for two different 
> kinds of thing, and provide different names for the different kinds.

I'm not sure anyone teaches this kind of "bottom-up" methodology any more.
You decide the tables in the database by modelling the categories of object
you find in the real world. And generally, if you find (say) that overseas
students have a visa-expiry-date while EU students do not, you don't
therefore decide to put EU students and overseas students into different
tables. That's partly, of course, because relational databases aren't very
good at doing type hierarchies.

DTD design tends to be based on studying documents rather than studying real
world objects, so the criteria are somewhat different. But even then, you
have to make a judgement as to whether an image-in-a-table has enough in
common with an image-outside-a-table to make it convenient to use the same
tagname rather than a different tagname; if one had to decide that any
difference in the applicable attributes meant the tagnames had to be
different, you would not only end up with a vast and unmemorable collection
of tagnames, but you would also, I think, have a vocabulary that is less
resilient to change.

Of course it's easy to find examples where tags have been overloaded
inappropriately: <a name>|<a href> comes to mind in HTML, and <xs:element
name>|<xs:element ref> in XSD. But what about xsl:param in XSLT? It's used
in three different places with slightly different attribute sets each time.
Is that appropriate or not?

Michael Kay

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.
First Name
Last Name
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.