W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

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

From: <Mike_Leditschke@nemmco.com.au>
Date: Mon, 31 Dec 2001 00:15:22 +1000
To: Jeni Tennison <jeni@jenitennison.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OFA3A56426.0613A3D2-ON4A256B32.004D02F9@nemmco.com.au>

Hi Jeni. It is the qualification of locally declared elements across
namespaces
that I was trying (badly) to clarify.

Suppose I declare in ns1 a complex type consisting of a sequence
of three locally declared elements. In addition I declare a <Head>
element from this type. Assuming I've used an elementFormDefault
of qualified, my instance doc, assuming no default namespace, might look
like

<ns1:Head>
  <ns1:El1/>
  <ns1:El2/>
  <ns1:El3/>
</ns1:Head>

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>

OR

<ns2:Substitution>
  <El1/>
  <El2/>
  <El3/>
  <El4/>
  <El4/>
</ns2:Substitution>

OR

something else?

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.

Thanks
Michael



                                                                                                                                        
                    Jeni Tennison                                                                                                       
                    <jeni@jeniten        To:     mike_leditschke@nemmco.com.au                                                          
                    nison.com>           cc:     xmlschema-dev@w3.org                                                                   
                                         Subject:     Re: Wrapped around the axle: Refining and extending structures across namespaces  
                    21/12/2001                                                                                                          
                    01:24 AM                                                                                                            
                    Please                                                                                                              
                    respond to                                                                                                          
                    Jeni Tennison                                                                                                       
                                                                                                                                        
                                                                                                                                        




> 3. What is the effect of elementFormDefault in the two schemas? For
> instance, if the head (say in ns1) defines some base content and
> uses a form default of qualifed, but the substitution element
> extending this (say in ns2) uses unqualified, does an instance using
> the the element from ns2 have both base and extended content
> unqualified, or the base stuff qualified and the extension stuff
> unqualified, or all qualified?

The elementFormDefault attribute defines whether elements that are
declared locally (in complex types or in model groups) are qualified
(in the target namespace) or unqualified (in no namespace) by default.

In fact, the elementFormDefault attribute has no effect when it comes
to the heads or members of substitution groups, because both the heads
and members of substitution groups *must* be global elements, declared
at the top level of the schema, and therefore in the target namespace.





Form doesn't apply to types - form is purely about the namespace of
elements and attributes.








------------------------------------------
This e-mail is confidential.  If you are not the intended recipient, any use, disclosure or copying of this document is unauthorised and prohibited.  If you have received this document in error, please delete the email and notify me by return email or by phoning the NEMMCO Helpdesk on 1300 300 295.
Received on Sunday, 30 December 2001 09:16:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:25 GMT