[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 http://www.saxonica.com/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|