Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Include and no namespace

From: "Arnaud Blandin" <ArnaudBlandin@-------.-->
To: <xmlschema-dev@--.--->
Date: 8/11/2004 1:12:00 PM
Hi all,

I have a question regarding the includes of XML Schemas with no namespace.
Consider the following example:

A.xsd
=====
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified">

 <xsd:complexType name="FooType">
 ...
 </xsd:complexType>
</xsd:schema>

B.xsd
=====
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified"
            xmlns:test="myNamespace"
            targetNamespace="myNamespace">

 <xsd:include schemaLocation="A.xsd"/>
 <xsd:element name="Bar" type="FooType"/>

</xsd:schema>

C.xsd
=====
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified"
            xmlns:test="myNamespace"
            targetNamespace="myNamespace">

 <xsd:redefine schemaLocation="B.xsd">
      <complexType name="FooType">
         ...
      </complexType> 
 </xsd:redefine>
 
 <xsd:complexType name="type">
     <xsd:sequence>
          <xsd:element name="Foo1" type="test:FooType"/>
          <xsd:element name="Foo2" type="FooType"/>
     </xsd:sequence>
 </xsd:complexType>
</xsd:schema>


How a schema processor is supposed to resolve the type of Foo2? 
Regarding the include of schema with no namespace I found this in the spec:

"In Schema Representation Constraint: Inclusion Constraints and Semantics 

3.2 If clause 2.3 above is satisfied, then the schema corresponding to the
<include>d item's parent <schema> must include not only definitions or
declarations corresponding to the appropriate members of its own [children],
but also components identical to all the *schema components* of I, except
that anywhere the *absent* target namespace name would have appeared, the
*actual value* of the targetNamespace [attribute] of SII' is used. In
particular, it replaces *absent* in the following places: 
3.2.1 The {target namespace} of named schema components, both at the top
level and (in the case of nested type definitions and nested attribute and
element declarations whose code was qualified) nested within definitions;
3.2.2 The {namespace constraint} of a wildcard, whether negated or not;"

To me it means: when I include A.xsd in B.xsd, FooType belongs to the
namespace 'myNamespace'. Then by using redefine, all the types of B.xsd are
now in C.xsd.
Thus for C.xsd point of view, FooType belongs to the namespace 'myNamespace'
and both Foo1 and Foo2 shares the SAME type.

Is my interpretation correct?

Regards,

Arnaud


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent