Re: Units of measure in XML documents

Discussion in 'XML' started by Peter Flynn, Jan 15, 2009.

  1. Peter Flynn

    Peter Flynn Guest

    Tom Wright wrote:
    > Hello
    >
    > I'm trying to find an up-to-date reference on units of measure in XML
    > documents. I've found quite a bit of stuff from around 1999-2002 at
    > posc.org which refers to a working group at W3C tasked with this problem,
    > but I've not found much more recent stuff and can't find anything at w3.org
    > or in a search of past messages on this group.
    >
    > Is there anything of the sort? Are there any current efforts in this
    > direction? I'd assumed as XML is so widely used that something like this
    > would be standardised, so maybe I'm missing the obvious. Any help would be
    > most welcome.


    The XML Spec does not address this: it's up to each document type
    designer to add validation criteria in the appropriate places. In a
    recent DTD for a book publisher, I had something like

    <!ATTLIST image
    width CDATA #REQUIRED
    units (mm|cm|in|pt|px|pc|pi|cc|dd|sp) "mm">

    I could have added meters and feet, but the client doesn't do poster
    work. Equally, a bibliographic application might require sizes in
    characters, lines, paragraphs, pages, signatures, issues, and volumes.
    On the other hand if you were designing for the scientific field, you'd
    probably want to specify SI units (there are *lots* of them :)

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
    Peter Flynn, Jan 15, 2009
    #1
    1. Advertising

  2. Peter Flynn

    Peter Flynn Guest

    Tom Wright wrote:
    > Peter Flynn wrote:
    >> On the other hand if you were designing for the scientific field, you'd
    >> probably want to specify SI units (there are *lots* of them :)

    >
    > Yep, that's the problem, and if I define my own then there's no saying
    > they'll be compatible with ones someone else defines


    Well, if you use the SI unit names you can claim you are simply adhering
    to the prevailing international standard. You cannot be attacked for
    that, except that SI is metric and does not cover older, traditional, or
    historic units. There are probably too many of those to codify sensibly.

    > which more-or-less defeats the point of using XML.


    Not really; it doesn't actually have much to do with XML. XML is a
    standard for markup. Measurement units are metadata.

    > (yes, it may be possible to translate, but if there's a standard then I'd
    > much rather use that)


    SI if it covers all the units you need. Otherwise use SI units for those
    it does cover, and consult an authority for the rest. The remaining
    Imperial units (feet, inches, pounds, acres etc) are well known, and the
    back of any 1950s school copybook will list the less common rods, poles,
    perches, grains, scruples, and drachms. For other (historical) measures,
    especially those from other cultures, perhaps ask your nearest
    librarian, or check with the TEI community (http://www.tei-c.org) whose
    members are well-acquainted with encoding historical documents in XML.

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
    Peter Flynn, Jan 17, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Syntext, Inc
    Replies:
    0
    Views:
    427
    Syntext, Inc
    Nov 15, 2004
  2. Replies:
    2
    Views:
    429
    TextDoctor
    May 7, 2005
  3. Replies:
    1
    Views:
    380
  4. Replies:
    1
    Views:
    480
    Juan T. Llibre
    Oct 18, 2006
  5. The Magpie
    Replies:
    3
    Views:
    520
    The Magpie
    Jan 20, 2009
Loading...

Share This Page