Re: Wrapped around the axle: Refining and extending structures across namespaces

Hi Mike,

> Now if I derive by extension in ns2 a new type from the above type
> and add two more locally declared elements, and declare a
> <Substitution> element based on this new type and in a substitution
> group with <Head>, but this time use an elementFormDefault of
> unqualified.
>
> In my instance doc,  would I end up with
>
> <ns2:Substitution>
>   <ns1:El1/>
>   <ns1:El2/>
>   <ns1:El3/>
>   <El4/>
>   <El4/>
> </ns2:Substitution>

Yes. The initial elements are qualified, so you look at the target
namespace of the schema in which they are declared to work out what
their namespace is (i.e. ns1). The elements that you add with the
extension are unqualified, so not in a namespace.

> Your comment that "form doesn't apply to types" would suggest the
> second and that the creator of the substitution element can subvert
> the intentions of the designer of the original head type in terms of
> qualification style in this case.

Sorry that what I said was confusing - something about your question
made me think you thought types could themselves be qualified or
unqualified.

The namespace for an element depends on its form (attribute or
inherited from elementFormDefault) and the target namespace of the
schema in which it is declared. You cannot change the namespace of an
element in a derived type.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Tuesday, 1 January 2002 04:52:37 UTC