[
Lists Home |
Date Index |
Thread Index
]
Jonathan Robie wrote:
> At 05:20 PM 12/26/2001 -0700, Champion, Mike wrote:
>
> >As the "T-word" thread here a few months ago
> >http://lists.xml.org/archives/xml-dev/200108/msg01042.html indicated,
"type"
> >is a bit of a dirty word in some perfectly respectable circles. I am
> >struggling with the concepts and terminology here (I took a stab at this
in
> >my post http://lists.xml.org/archives/xml-dev/200112/msg00356.html and
> >didn't get much followup). The various distinctions among classes,
types,
> >and domains make my head hurt, and I don't claim to have any deep
insights.
>
...
>
> We haven't been very systematic about types in the XML world. As a result,
> everyone has their own conception of types in XML, and it gets
increasingly
> difficult to say anything about types as each word we might want to use
> gets reserved for some purpose in some community. Most people confuse the
> XML types with types in their favorite system - eg relational or object
> oriented. The RDF and XML communities also think of types somewhat
> differently. So the whole discussion of types in XML has been confusing
and
> frustrating for many people, and different communities have had a hard
time
> communicating because of differing fundamental assumptions about how types
> work. I think we need greater clarity on types in XML, and I hope this
will
> be one result of the XML Query work. I personally think that RELAX-NG and
> the XML Schema Formal Description have also contributed to clarity in
these
> areas.
I agree.
When everyone has a different idea of what a type is, then the issue does
get very confusing and we refer to types as "t***". It is difficult to have
a rational discussion when the meanings of words that we frequently use
become overloaded with similar but slightly different meanings. I completely
agree that the common usage of the term "type" is as in object oriented
programming, and I also agree with the sentiment that object oriented
programming and XML are largely orthogonal (though complimentary) in
purpose.
Why not consider a type as a regular expression or pattern. An XML type is
simply a label attached to a unicode string that is within an XML document.
As Murata Makoto's talk at this past Extreme Markup Technologies showed,
DTDs, W3C XML Schema 1.0, and RELAXNG define forms of grammars, essentially
forms of regular expressions that can be used to label a piece of XML.
What then is the essential difference between RELAXNG patterns and XML
Schema types (these two have been positioned as opposing concepts)?
To me, the difference is _simply_ that XML Schema types define an explicit
derivation framework (restriction/extension) where RELAXNG patterns _appear_
less hierarchical yet in reality one can derive certain patterns from other
patterns.
So a RELAXNG pattern name can be simply used in the XPath "element of type"
expression, or imagine a function which returns a type from a DTD
expression: dtdType("(foo,bar,baz)+")
If we start looking at _types_ as string based or _XML types_ (e.g. regular
expressions) rather than types commonly associated with binary programming
languages, then we can stop refering to types as t***. Of course YMMMV, as
always.
Jonathan
|