- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 05 Jun 2000 09:31:03 +0100
- To: richard torres <richard.torres@yale.edu>
- Cc: www-xml-schema-comments@w3.org
richard torres <richard.torres@yale.edu> writes:
> I understand how extension works, but am confused about restriction. Do
> you have to repeat everything that is not changed.
> With restriction
> type 1
> element 1 minOccurs=0 maxOccurs=1
> element 2 minOccurs=0 maxOccurs=1
> element 3 minOccurs=0 maxOccurs=1
>
> Which is correct to delete element 1, but keep 2 and 3 as they are?
>
> type 2 by restriction of type 1
> element 1 maxOccurs=0
>
> or
>
> type 2 by restriction of type 1
> element 1 maxOccurs=0
> element 2 minOccurs=0 maxOccurs=1
> element 3 minOccurs=0 maxOccurs=1
The second is correct, but not minimal. To define by restriction, you
provide a complete content model, which must be matchable one-to-one
back to the old one. So in the case above you can say:
type 2 by restriction of type 1
element 2 minOccurs=0 maxOccurs=1
element 3 minOccurs=0 maxOccurs=1
Things can be left out as long as they were optional in the base.
For attributes, since there's no ordering to help with the matching
up, you _must_ use the maxOccurs=0 approach, and things not mentioned
are copied.
ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
W3C Fellow 1999--2001, part-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
Received on Monday, 5 June 2000 04:31:07 UTC