[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

ANN: a portable data component -- length

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Sat, 9 Apr 2011 11:10:26 -0400

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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.