[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: RE: RELAX NG and type derivation [Was:] XQuery andDTD/Sche


implicit subtyping

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

<foo>
  <bar>Hello World</bar>
</foo>

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
assignment.

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;
> From
> 	<int>foo</int>
> (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.
>
> -derek


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.