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
    > 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
    > 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
    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 :)

    XML FAQ:
    Peter Flynn, Jan 15, 2009
    1. Advertisements

  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 ( whose
    members are well-acquainted with encoding historical documents in XML.

    XML FAQ:
    Peter Flynn, Jan 17, 2009
    1. Advertisements

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
    Syntext, Inc
    Nov 15, 2004
  2. Replies:
    May 7, 2005
  3. Replies:
  4. Replies:
    Juan T. Llibre
    Oct 18, 2006
  5. The Magpie
    The Magpie
    Jan 20, 2009

Share This Page