W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2004

RE: Range extension with redefine

From: Hirtle, David <David.Hirtle@nrc-cnrc.gc.ca>
Date: Mon, 3 May 2004 09:12:45 -0400
Message-ID: <10C94843061E094A98C02EB77CFC32870A1E2E5B@nrcmrdex1d.imsb.nrc.ca>
To: "'ht@inf.ed.ac.uk'" <ht@inf.ed.ac.uk>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>, "Boley, Harold" <Harold.Boley@nrc-cnrc.gc.ca>

Thank you for your response.

The "design for change" you refer to is exactly the approach I'm currently
employing.  Unfortunately, what you suggested _is_ limited and doesn't
permit what I'm trying to accomplish.  Namely, I'd like to widen the lower
bound of an occurrence range.  While your solution manages to widen the
upper bound by adding on to the sequence, it doesn't help with going from
e.g. minOccurs="1" down to minOccurs="0" (and this is exactly what I need to
do).  Changing the compositor to choice, of course, results in
non-determinism.

For example, single.xsd would permit a single occurrence of element <a>,
while star.xsd would permit 0 or more occurrences of said element (by
redefining single.xsd).

Is this possible?  It seems to me that there must be a way.

Thanks again.

David

-----Original Message-----
From: ht@inf.ed.ac.uk [mailto:ht@inf.ed.ac.uk]
Sent: April 30, 2004 6:06 AM
To: Hirtle, David
Cc: 'xmlschema-dev@w3.org'
Subject: Re: Range extension with redefine

"Hirtle, David" <David.Hirtle@nrc-cnrc.gc.ca> writes:

> A simple question: How does one "extend" a particle's occurrence range
with
> <redefine>?  I am familiar with the specification's discussion of valid
> restrictions (http://www.w3.org/TR/xmlschema-1/#cd-model-restriction), but
> there seems to be no way to do the opposite of _extending_ an occurrence
> range.
>
> For example:
>
> one.xsd
> -------
> <xs:group name="some_group">
> 	<xs:sequence>
> 		<xs:element ref="a"/>
> 	</xs:sequence>
> </xs:group>

The following will achieve your goal, but it's clearly limited to
certain restricted cases:

two.xsd
-------
<xs:redefine schemaLocation="one.xsd">
  <xs:group name="some_group">
    <xs:sequence>
      <xs:group ref="some_group"/>
      <xs:element ref="a" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>
</xs:redefine>

This points towards a rather extreme design-for-change approach in
which _all_ element references in content models are replaced by
group references to single-element content models, so that you can
change any aspect of the model by a subsequent group redefinition.

ht
-- 
 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@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged
spam]
Received on Monday, 3 May 2004 09:13:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:43 GMT