Lists Home |
Date Index |
derek, let me try to answer my point of view. I should say that I am not a
PL person, and the subtle differences between classes and types are
unclear to me. But I hope we can discuss w/o getting into the fine details
of this terminology..
Let us consider typing of data only, and let us consider Java as our
Programming Language. (I have heard from PL people that in Java, typing is
in-built with the language..)
Now whenever we declare a variable, the user *has* to assign it to a
class/type. Therefore all objects will have types user has declared.
However, it is not the same for XML Schemas. Consider
NT1 -> foo (NT2*, NT3*)
NT2 -> bar (String)
NT3 -> bar (String)
where NT1, NT2 and NT3 are types.
A document that conforms to it is
Now, I consider each element as an object. The types of the objects are
*not* assigned by the user, in stead a processor has to do type
As a result of this, sometimes we can have ambiguities, for example the
bar element can be assigned type NT2 or NT3.
I would like to decline to comment on whether the user would like
explicit subtyping or implicit subtyping. I would rather like to say that
implicit subtyping has unsolved issues, which are *very* interesting to
study, though implicit subtyping might not get accepted in practice...
There is another issue -- should subtyping be for hedge types or tree
types. This is what I am studying now.
thanks and regards - murali.
On Mon, 8 Jul 2002, Derek Denny-Brown wrote:
> " Let us look at type assignment more closely. In traditional
> programming languages, type assignment is non-existent - here, type
> assignment for objects is done by the user. The user provides a set of
> type definitions, and whenever he creates an object, he explicitly
> declares the type to which the object belongs. However, it is
> different for XML Schemas."
> I disagree with this. C++ static struct instance initialization
> provides a limited form of type assignment. XML makes some things
> easier, since every sub-match is named, but then makes it all very
> complicated by with content-models. I would argue that most people do
> not differentiate
> int foo;
> (where there is the appropriate schema definitions)
> My general opinion of subsumption based typing frameworks is that
> while the danger of allowing subsumptive-based subtyping, where there
> was not such intent is not worth the gain. This is partly due to the
> fact that tag names tend to be based on language, and language allows
> multiple meanings of a given term, where the correct meaning is
> expected to be derived by context. I strongly believe that subtyping
> must be explicit, specifically to remove the opportunity for
> unintended subtyping of trees. Using a subsumption framework to
> validate explicit subtyping declarations is fine, but I am very wary
> of anything which attempts to derive intent that was not made
> explicit, when the penalty for incorrect derivation is high, as it is
> in this case.
> Then again, I have little doubt that you can use a subsumptive
> framework to define a subtyping solution which is simpler and clearer
> than XSD.