- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: Tue, 26 Aug 2003 09:48:44 +0100
- To: "Alain Andrieux" <aa_vrac@hotmail.com>
- Cc: xmlschema-dev@w3.org
"Alain Andrieux" <aa_vrac@hotmail.com> writes:
>> > Can I use the derived type as the type of an element which is a
>> > restriction of an element defined in a base type derived by
>> > restriction?
>> Sorry, I can't make sense of this -- you can use any type _you_ define
>> legally as the type defn of any of your own elements, or as the base
>> for other types you define. All you can't do is use them where the
>> original base type (with the 'block' attribute' was expected.
>
> What I have in mind is, using a very simplified declaration:
>
> in schema A:
>
> <schema targetNamespace="nsA" blockDefault="#all" [...] //note the
> blockDefault here
> <complexType name="Customer">
> <sequence>
> <element name="address" type="Address"
> </sequence>
> </complexType>
>
> <complexType name="Address">
> [...]
> </complexType>
>
> </schema>
>
> in schema B, importing schema A:
>
> <schema targetNamespace="nsB"
> <import [...] location=schemaB/>
> <complexType name="MyCustomer">
> <restriction base="nsA:Customer">
> <sequence>
> <element name="address" type="MyAddress" //type restriction
> </sequence>
> </restriction>
> </complexType>
>
> <complexType name="MyAddress">
> <restriction base="nsA:Address">
> [...]
> <restriction>
> </complexType>
> </schema>
Sure, those are fine schema docs, and instances _in nsB_ can use them
w/o conflict with the block. What you _can't_ do is
<nsA:address xsi:type=nsB:MyAddress> . . .
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@cogsci.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 Tuesday, 26 August 2003 04:48:46 UTC