Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Include and no namespace

From: Xan Gregg <xan.gregg@---.--->
To: "Arnaud Blandin" <ArnaudBlandin@-------.-->
Date: 8/11/2004 5:01:00 AM
You've got it about right, though when discussing these features it's 
useful to be clear about the distinction between a schema (the set of 
components) and a schema document (the .xsd xml document).  I'll 
rewrite your conclusion using "X.xsd" for the schema document and 
"schema(X.xsd)" for the schema produced from parsing X.xsd (and any 
necessary includes, redefines and imports).

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

Correct if there is an xmlns="myNamespace" in B.xsd and C.xsd, which 
may be what you intended.  As it is, the type of Foo2 is FooType with 
no namespace, which doesn't correspond to any type in the schema.  Same 
for the type of Bar.

So to answer your initial question,

> How is a schema processor supposed to resolve the type of Foo2?

As it is (without the default namespace decl), a processor should not 
be able to resolve the type of Foo2.

xan
-------------------------------
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>


From jeni@j... Wed Aug 11 14:17:59 2004
Received: from dr-nick.w3.org ([18.29.1.73])


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