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


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] 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]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS