Re: From XML to (X)HTML with Semantics Intact

Just to clarify, Roger...are you talking about doing this with RDFa?
If so, then it's quite straightforward, but without it there is no way
you can do this in XHTML.

Some would suggest that you can use @class, but if you do, the names
are not scoped, and the problem is that you can't be sure that other
people haven't used the same values as you in documents that are
completely unrelated to geo location information.

Others would suggest using special geo formats, but they usually only
work by setting up a series of conventions, and they won't always play
nicely with other sets of information if you start to try to mix them
up.

However, RDFa allows something like this:

  <ul>
    <li property="geo:lat">32.904237</li>
    <li property="geo:long">73.620290</li>
    <li property="x:uncertainty" datatype="metres">2</li>
  </ul>

or this:

  I'm <span property="x:uncertainty" datatype="metres" content="2">reasonably
  sure</span> that I live at <span property="geo:lat">32.904237</span>,
  <span property="geo:long">73.620290</span>.

The key thing here is that the meta information and the document
structure can in a sense be seen as being in two different 'planes'.
The data that you live at 32,73 is independent of the use of spans or
unordered lists to make that information readable.

RDFa will shortly be available as a module for use independently of
XHTML 2, so everything I have described here is doable. Some notes on
RDFa and XHTML Modularisation are here:

  http://skimstone.x-port.net/node/213

Regards,

Mark


On 25/07/06, Costello, Roger L. <costello@mitre.org> wrote:
>
>
>
>
> Hi Folks,
>
>
>
> Consider this XML:
>
>
>
> <location>
>
>           <latitude>32.904237</latitude>
>
>           <longitude>73.620290</longitude>
>
>           <uncertainty units="meters">2</uncertainty>
>
> </location>
>
>
>
> It has quite a lot of semantics – it has information about a location;
> namely, the location is represented by a collection  (no sequence implied)
> of values, one representing the latitude, one representing the longitude,
> and one representing the uncertainty of measurement.
>
>
>
> How would you represent this in (X)HTML, with all of the semantic richness
> retained?  That is, can (X)HTML capture all of the semantic richness, albeit
> in a different form/markup?
>
>
>
> One possible solution is this:
>
>
>
> <h1>Location</h1>
>
> <ul>
>
>     <li>Latitude: 32.904237</li>
>
>     <li>Longitude: 73.620290</li>
>
>     <li>Uncertainty: 2 meters</li>
>
> </ul>
>
>
>
> While this does seem to provide the same information as the above XML, I am
> a bit uneasy about it.  Can you suggest a way of expressing the information
> in (X)HTML that retains the semantic richness of the XML?
>
>
>
> /Roger
>
>


-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/

Received on Tuesday, 25 July 2006 22:24:08 UTC