Re: Mapping XML to XHTML - your recommendation for handling attributes?

Le 27 août 06 à 06:31, Costello, Roger L. a écrit :
> Leaf nodes in the XML document I map to an XHTML <dl> element, e.g.,

"dl" element is not appropriate for what you are doing.
dl means "definition list" aka a list of definitions.

> <aircraft_elevation>12000</aircraft_elevation>
>
> I map to:
>
> <dl class=”aircraft_elevation”>
>
>       <dt>Aircraft Elevation</dt>
>
>       <dd>12000</dd>
>
> </dl>
>
>  Now suppose <aircraft_elevation> has an attribute:
> <aircraft_elevation units=”meters”>12000</aircraft_elevation>
>
>
>
> How do you recommend I map the attribute?

For each things you decide in a markup language or on how to model  
data, you have to ask yourself first.
	What do you want to do?

* What will be the benefits for you to have these data expressed in  
an XHTML 1.0 page?
* Do you have specific needs for making these data accessible online  
in a predefined format?
* Is there a community which will be interested in grabbing semi- 
formatted data in your XHTML more than an RDF file or an XML file?


(A side note: "meters" is not strictly a unit "m" is one expressing  
meters.)

Some suggestions:

<span title="aircraft elevation">12000 meters</span>


or if you really need more expressiveness

<span title="aircraft elevation">12000 <span title="meters">m</span></ 
span>



You can look at
   GRDDL: Gleaning Resource Descriptions from Dialects of Languages
   http://www.w3.org/TeamSubmission/grddl/
if you want to grab data from an XHTML 1.0 page in a consistent way.

You might be able to use RDFa in XHTML 2.0 (but still a WD then  
highly subject to changes)


PS: Maybe a better list would have been public-evangelist@w3.org



-- 
Karl Dubost - http://www.w3.org/People/karl/
W3C Conformance Manager, QA Activity Lead
   QA Weblog - http://www.w3.org/QA/
      *** Be Strict To Be Cool ***

Received on Monday, 28 August 2006 00:20:17 UTC