Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Understanding Restrictions on Groups

From: ht@---.--.--.-- (----- -. --------)
To: "Eliot Kimber" <ekimber@---------------.--->
Date: 6/26/2007 12:49:00 PM
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eliot Kimber writes:

> I'm trying to understand what I can and can't do with restrictions on 
> groups.
>
> What I want to do is redefine a group in order to completely replace its=
 
> members, rather than extending its members. What I have that works 
> (using OxygenXML 8.2, which I believe uses XercesJ 2.9):

Well, in principle you can't do that.  W3C XML Schema defines
restriction as the elimination of _optional_ content, so getting rid
of _required_ content isn't allowed.

The motivation is to provide an invariant rather like that of
object-oriented programming languages:  any valid member of a type
defined by restriction is also a valid member of the type defined by
its base.

Having said that, there's a loophole in practice (which will probably
be closed in XML Schema 1.1 -- you have been warned!), which means you
can get what you want if you do it in two steps:

Redefine2.xsd:

<xs:redefine schemaLocation="Redefine.xsd">

   <xs:group name="a">
     <xs:choice>
       <xs:group ref="b"/>
     </xs:choice>
   </xs:group>

</xs:redefine>

First step extends the original by wrapping it in a choice with 'b',
second step restricts away the now-optional 'a'.  Don't try this at
home, even sending this message makes me feel a bit guilty :-)

ht
=2D -- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@i...
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged sp=
am]
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFGgO8JkjnJixAXWBoRAsZHAJwIxUoBaW9qs39aSVZCEzWbGo/UXwCfZ+vi
gOYbmzG+T/+UTTBv8aLD1cU=
=NfIM
=2D----END PGP SIGNATURE-----

From mike@s... Tue Jun 26 12:16:33 2007
Received: from maggie.w3.org ([193.51.208.68])
	by 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent