[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] deriving by restriction
Reference: XML Schema Part 0: sep 22, 2000 draft Section 4.4 (Deriving Complex Types by Restriction), page 35 of 60 states "Note that all ConfirmedItems type elements will also be acceptable as Item type elements" My question is - "is this correct?" In the example, ConfirmedItems is derived by restriction and minOccurs is changed to "1" (from "0" in base type) - if only this was the case, I agree ConfirmedItems are acceptable as Item type elements also. However, the remainder of the definition of Items is reproduced in the example (which i believe is not for easier reference but because the same is required). The same could have been further restricted to exclude say productName (whose minOccurs by default is 1 in the base "Item". Is this an error case. if yes, then why do we have to reproduce the entire baggage?) from the Item sequence. Clearly, "ConfirmedItems" now will not be "acceptable" as "Item". i.e. ConfirmedItems are not "valid" Item (thinking coming from OO world). I am distinguishing between - ConfirmedItems as subset of Item from ConfirmedItems as also being a valid Item. What am I missing in my understanding? Thank you and regards, Ajay
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|