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

Re: Clarification for use of xs:include

From: Roberto Chinnici <Roberto.Chinnici@Sun.COM>
Date: Mon, 13 Sep 2004 10:21:11 -0700
To: "Liu, Kevin" <kevin.liu@sap.com>
Cc: www-ws-desc@w3.org, "David Booth (dbooth@w3.org)" <dbooth@w3.org>
Message-id: <4145D707.60107@sun.com>

Liu, Kevin wrote:
> part 1 section 3.1.2 states:
> "Inside an embedded XML schema, the |xs:import| and |xs:include| 
> /element information item/s MAY be used to refer to other XML schemas 
> embedded in the same WSDL description, provided that an appropriate 
> value is specified for their |schemaLocation| /attribute information 
> item/s. The semantics of such /element information item/s are governed 
> solely by the XML Schema specification [XML Schema: Structures 
> <http://www.w3.org/TR/2004/WD-wsdl20-20040803/#XMLSchemaP1>]." It 
> doesn't say anything about what's the "appropriate value" and implies 
> that it's the question for schema spec.
>  
> I searched our mail archival, there were many messages exchanged about 
> this but seems no conclusion was drawn about what the "appropriate 
> value" should be for @schemalocations in the following example? 
>  
> <type>
>     <xs:schema targetNamespace = "a"> ....</schema>
>  
>     <xs:schema targetNamespace = "b">
>         <xs:import namespace = "a" schemalocation = "???"/> ...
>     </schema>
>  
>     <xs:schema targetNamespace = "a">
>         <xs:include  schemalocation = "???"/> ...
>     </schema>
>  
> <type>
>  
> Some suggested that for the xs:import in "b", the @schemalocation 
> should not present (it's optional anyway).  But nothing has been said 
> about the case for the second "a" which xs:includes the first "a". is it 
> legal (the spec quoted above implies yes)? if so, what's the right value 
> for xs:include@schemaLocation(not it's a required attribute ) ?  
>  
> Any one can help? Since this a confusing area, I am thinking to include 
> something in the Primer.

How about using the "id" attribute and a fragment identifier? E.g.

<type>
     <xs:schema targetNamespace = "a" id="a"> ....</schema>

     <xs:schema targetNamespace = "b">
         <xs:import namespace = "a" schemalocation = "#a"/> ...
     </schema>

     <xs:schema targetNamespace = "a">
         <xs:include  schemalocation = "#a"/> ...
     </schema>

<type>

Roberto
Received on Monday, 13 September 2004 17:21:25 GMT

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