[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Auto-generate a DTD from multiple XML documents?
Hi Jon, You really should consider using semantic markup, which would be more accessible and easier to customise for different output formats than your current presentational mish-mash: > <slappinghandonhead andsaying="duh"/> This markup presumes that the user has a hand, not to mention a head, and engages in vocal communication in a single language with no opportunity for translations or explanations of what to many would be an unfamiliar idiom. We can start by adding language tags so that multiple language streams can be used simultaneously. This requires placing the text in an element rather than an attribute, which is better practice for this use case: <slappinghandonhead> <andsaying xml:lang="en">duh</andsaying> </slappinghandonhead> However, this nesting arbitrarily prioritises the slapping over the saying, when the two actions are essentially independent and would be rendered in parallel by an XML-driven audiovisual renderer. We can reflect this inherent parallelism by making them siblings: <action> <slappinghandonhead/> <saying xml:lang="en">duh</saying> </action> The next problem is obvious: the creation of a specific element for the sub-action of slappinghandonhead is far too specific, and requires the vocabulary to be extended every time a new object needs to be slapped, or a new object is used to do the slapping. We can parameterise this element and make it much more flexible: <action> <slapping> <appendage ref="hand"/> <target ref="head"/> </slapping> <saying xml:lang="en">duh</saying> </action> Now the markup is getting better, but it's still not conveying meaning. Let's take inspiration from MathML 2.0 and combine parallel presentation and content markup: <semantics> <action id="a1"> <slapping> <appendage ref="hand"/> <target ref="head"/> </slapping> <saying xml:lang="en">duh</saying> </action> <annotation-xml encoding="RDF-XML"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.com/"> <rdf:Description rdf:about="#a1"> <ex:longdesc> Gesture and vocalisation indicating that the person has missed a detail that should have been obvious. </ex:longdesc> </rdf:Description> </rdf:RDF> </annotation-xml> </semantics> This could be polished a little further with the addition of a namespace for the action element subtree and further semantic cross-references for the head and hand appendage to explain them in detail to users who lack them, but it's a start. As you can see, if you take a bit more care with the XML that you use, people will find it a lot easier to understand! Best regards, Michael PS. <tonguelocation is="firmly-in-cheek"/> -- Print XML with Prince! http://www.princexml.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
|