W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

extension vs restriction

From: richard torres <richard.torres@yale.edu>
Date: Fri, 26 May 2000 11:11:35 -0400
To: www-xml-schema-comments@w3.org
Message-id: <392E9427.EA25F091@yale.edu>
I understand how extension works, but am confused about restriction.  Do
you have to repeat everything that is not changed.

With extension
type 1
    element 1
    element 2
    element 3

type 2 by extension of type 1
    element 4
    element 5

Now type 2 has elements 1-5
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
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

In otherwords, do you have to do this extra typing?

thank you
Received on Friday, 26 May 2000 11:07:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:47 UTC