[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?

  • From: Michael Day <mikeday@y...>
  • To: Jon Noring <jon@n...>
  • Date: Mon, 08 Oct 2007 10:59:31 +1000

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:

     <andsaying xml:lang="en">duh</andsaying>

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:

     <saying xml:lang="en">duh</saying>

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:

         <appendage ref="hand"/>
         <target ref="head"/>
     <saying xml:lang="en">duh</saying>

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:

     <action id="a1">
             <appendage ref="hand"/>
             <target ref="head"/>
         <saying xml:lang="en">duh</saying>
     <annotation-xml encoding="RDF-XML">
         <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             <rdf:Description rdf:about="#a1">
                     Gesture and vocalisation indicating that the person
                     has missed a detail that should have been obvious.

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,


PS. <tonguelocation is="firmly-in-cheek"/>

Print XML with Prince!

[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.