W3C home > Mailing lists > Public > www-ws-desc@w3.org > November 2004

RE: inline schema import usage

From: Martin Gudgin <mgudgin@microsoft.com>
Date: Wed, 3 Nov 2004 11:02:38 -0800
Message-ID: <DD35CC66F54D8248B6E04232892B633803D706D7@RED-MSG-43.redmond.corp.microsoft.com>
To: "Jeehong Min" <jeehongm@parasoft.com>, <www-ws-desc@w3.org>

 

> -----Original Message-----
> From: www-ws-desc-request@w3.org 
> [mailto:www-ws-desc-request@w3.org] On Behalf Of Jeehong Min
> Sent: 02 November 2004 19:00
> To: www-ws-desc@w3.org
> Subject: inline schema import usage
> 
> 
> I have a "yes" or "no" clarification question about the usage 
> of import in 
> an inline schema.
> 
> Consider the legal WSDL fragment below.  My question is:
> 1. Would the inline schemas be fine without the import 
> statements?  

No.

> Or do 
> they need the import statements since each schema references 
> a type defined 
> in the other schema?

Yes, the import statements are a necessary ( but not sufficient )
condition for refering from one *schema* to components in another
*schema* and namespace. The other necessary condition is a namespace
declaration.

> 
> I was leaning toward concluding that the import statements 
> are needed, but I 
> found the following comment by Jonathan Marsh which made me 
> unsure: "In 
> WSDL, we say that QName references to schema-defined QNames 
> must come from 
> either the targetNamespace of an inlined schema, or a 
> namespace indicated by 
> an import." 
> (http://lists.w3.org/Archives/Public/www-ws-desc/2003Oct/0174.html)
> 
> Does the phrase "... must come from either the 
> targetNamespace of an inlined 
> schema" mean that import statements are not needed for 
> namespaces that are 
> targetNamespaces of other inline schemas?

Jonathan's statement was about refering to schema components from
*wsdl*.

> 
> Also, another reason why I ask is that I have customers who 
> are telling me 
> that IBM WSAD and XML Spy are handling inline schemas without 
> the import 
> statements.

I think per the XML Schema Part 1 spec section 3.15.3[1] that behaviour
is incorrect. Clause 4 under Schema Representation Constraint: QName
resolution (Schema Document) is the crucial piece:

" its *namespace name* is either the target namespace of the schema
document containing the *QName* or that schema document contains an
<import> element information item the *actual value* of whose namespace
[attribute] is identical to that *namespace name*. "

Gudge

[1]
http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#section-Constraints-
on-XML-Representations-of-Schemas

> 
> ------
> 
> <types>
>  <schema targetNamespace="http://namespace1" xmlns=
>   http://www.w3.org/2001/XMLSchema xmlns:two="http://namespace2">
>   <import namespace="http://namespace2"/>
>    <complexType name="myComplexType">
>     <sequence>
>      <element name="myElement" type="two:B"/>
>     </sequence>
>    </complexType>
>     <complexType name="A">
>      <sequence>
>       <element name="elementA" type="xsd:string"/>
>      </sequence>
>     </complexType>
>    </schema>
>    <schema targetNamespace="http://namespace2" 
> xmlns="http://www.w3.org/2001/XMLSchema"
>  xmlns:one="http://namespace1">
>     <import namespace="http://namespace1"/>
>     <complexType name="myComplexType">
>      <sequence>
>       <element name="myElement" type="one:A"/>
>      </sequence>
>     </complexType>
>     <complexType name="B">
>      <sequence>
>       <element name="elementB" type="xsd:string"/>
>      </sequence>
>     </complexType>
>    </schema>
> </types>
> 
> -------
> 
> Thanks,
> 
> Jeehong Min
> Software Engineer
> SOAPtest Development
> Parasoft Corporation
> 
> "We Make Software Work" 
> 
> 
> 
Received on Wednesday, 3 November 2004 19:03:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:33 GMT