XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
ANN: a portable data component -- length

Hi Folks,

[Definition] Portable Data Component: a chunk of markup that can be taken out of one context and dropped into another context, unchanged. The component does not depend on its context for evaluating its constraints.


EXAMPLE #1

Here is the altitude of an aircraft, expressed in both feet and meters:

     <altitude>
         <feet>12000</feet>
         <meters>3657.6</meters>
     </altitude>

It is important that the two length values are consistent:

   meters = feet * 12 inches/ft * 2.54 cm/in * m/100cm
          = 12000 * 12 * 2.54 * 0.01
          = 3657.6


The following is invalid because the values are not consistent:

     <altitude>
         <feet>12000</feet>
         <meters>4000</meters>
     </altitude>

This example shows that there is a constraint between the value of the <feet> element and the value of the <meters> element.


EXAMPLE #2
 
Here is the distance from my home to Boston, expressed in both miles and kilometers:

    <distance-to-Boston>
        <miles>40</miles>
        <kilometers>64.37376</kilometers>
    </distance-to-Boston>

It may be desired to express the distance in yards as well: 

    <distance-to-Boston>
        <miles>40</miles>
        <kilometers>64.37376</kilometers>
        <yards>70400</yards>
    </distance-to-Boston>

There is a constraint between the value of the <miles> element, the <kilometers> element, and the <yards> element.


DESIRED CHARACTERISTICS OF A "LENGTH" DATA COMPONENT

It would be useful to create a data component that:

(1) Permits a length to be expressed in various units

(2) Ensures that the values in different units are consistent

(3) Can be dropped into different contexts without alteration


We have created a data component that possesses these characteristics!


PORTABLE LENGTH DATA COMPONENT

Here is the portable length data component:

http://www.xfront.com/xml-schema-1-1/best-practice/portable-data-components/length.xsd

Here is a sample XML instance document:

http://www.xfront.com/xml-schema-1-1/best-practice/portable-data-components/test.xml


ACKNOWLEDGEMENTS

Thanks to the following people for the development of the portable length data component:

- Mike Brenner
- Roger Costello
- Michael Fletcher
- Mukul Gandhi
- Stephen Green
- Jasen Jacobsen
- Bob Natale


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS