Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Auto-generate a DTD from multiple XML documents?

From: Michael Day <mikeday@--------.--->
To: Jon Noring <jon@------.---->
Date: 10/8/2007 1:00:00 AM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent