OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] RE: RELAX NG and type derivation [Was:] XQuery and DTD/Sch

[ Lists Home | Date Index | Thread Index ]

John Cowan wrote:
> A WXS schema imposes three kinds of constraints:
>
> 1) Schema-instance constraints: if an attribute is declared to have
> a certain (simple) type in the schema, then all values of that
> attribute in the instance must conform to the type.
>
> 2) Instance-instance constraints: if an attribute is declared to be
> unique, then no two values of that attribute in the instance may be
> equal (according to the definition of "equality" for the attribute's
> type).
>
> 3) Schema-schema constraints: if a complex type is said to be
> derived by restriction from another complex type, then it must
> redeclare the components of that type either unchanged or reduced in
> what may be called "strength".
>
> RNG does not have constraints of types 2 or 3. Therefore, it cannot
> specify complex type derivation by restriction. In addition,
> restricting simple types by facet is not a first-class operation, so
> once a built-in simple type has been restricted by facets, it can't
> be restricted further. This is a place where WXS is genuinely more
> orthogonal than RNG.
>
> (IMHO the way in which complex type derivation by restriction is
> done is bogus, because it generates fragile subclasses, a kind of
> bassackwards version of the well-known "fragile superclass" problem
> in OO.)

Couldn't <concur> be used to provide (very powerful and loosely
coupled) derivation by restriction if it was reintroduced to RELAX NG?
Along the lines of:

<define name="base">
  ... base definition ...
</define>

<define name="restriction">
  <concur>
    <ref name="base" />
    ... restrictions ...
  </concur>
</define>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS