[
Lists Home |
Date Index |
Thread Index
]
- From: <david@megginson.com>
- To: <xml-dev@ic.ac.uk>
- Date: Thu, 26 Nov 1998 10:53:38 -0500 (EST)
Michael Kay writes:
> Rather my complaint was about things that I'd like to do in the
> data interchange world but can't. As Ron says, I can't do data
> typing in XML 1.0, and Paul's explanation doesn't alter the fact.
XML is a metalanguage for defining markup languages: in the markup
languages that you define with it, you can do any sort of data typing
you want:
<class id="person">
<name>Person</name>
<inherits-from>Object</inherits-from>
<member type="primitive">
<name>name</name>
<type>string</type>
<max>24</max>
</member>
<member type="primitive">
<name>age</name>
<type>int</type>
</member>
</class>
<object class-id="person">
<member name="name">David Megginson</member>
<member name="age">34</member>
</object>
<object class-id="person">
<member name="name">Tess Megginson</member>
<member name="age">3</member>
</object>
Your complaint is not that XML does not support data typing, but that
generic XML parsing tools do not enforce the kind of data typing that
you need out of the box. One of the reasons for this is that
everyone's requirements are different; I might want
<name type="city">Kingston</name>
where the type is enforced to be the name of a city that is currently
in my database. Someone else might want
<subject type="LC">BS</subject>
where the contents must be a Library of Congress subject.
That said, many people believe that there might be a small set of
data-typing primitives that have enough usefulness that they should be
standardised across all XML implementations rather than being defined
separately for each XML-based markup language. As Paul (I think) has
pointed out, the document people can use these just as easily as the
data people can.
By the way, the XML 1.0 spec does include at least one data-typing
attribute, 'xml:lang'.
All the best,
David
--
David Megginson david@megginson.com
http://www.megginson.com/
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
|