Re: Can one inline schema import definitions from a second inline schema?

Jonathan Marsh wrote:

>I had a question Umit about a statement you made this morning on this
>subject, that we should not do any inlining of schemas, relying always
>on importing an external schema, because that would help us use Schema
>monolithically instead of retrofitting changes into the Schema spec.  At
>least that's what I heard :-).
>

Hi Jonathan,

What i was trying to convey is that we should not be redefining schema specification for WSDL purposes. In my opinion regardless of whether the schemas are defined in a separate file or they are imported, their definitions should not be different. I should get the same effect. In other words, one should not be inlining schemas just so that different scoping rules or interpretations to what schema provides. 


This is why I proposed that we leave schema issues to Schema and always 
import an external schema document/file.

>
>I don't think this is accurate.  As far as I can find, Schema doesn't
>operate differently just because the <xs:schema> element appears as a
>root element.  There isn't a difference between creating a set of
>components from two imported schemas instead of two inlined schemas.  We
>require a targetNamespace on both imported and inlined schemas, which is
>I think the only restriction we place on Schema instances.
>  
>
Hmm. I am confused after reading your email because it looks like 
perhaps we are agreeing although it reads like we are disagreeing from 
your message. I agree that schema should not operate differently 
regardless of how it is defined.

>Replacing imported schemas with an inlined version has only one effect I
>can find: the disappearance of the schemaLocation hint.  
>
I am not sure I follow your last statement. Can you tell me where  this 
is defined in the schema spec. Why should they dissappear though?


>When
><xs:import> is used, the system locates a schema through some magic,
>which may involve use of the schemaLocation attribute.  We don't
>constrain this in any way. A processor is free to simply say "I can't
>find a corresponding schema" and fail any processing that requires
>components from that schema.  The implication of an inlined schema is
>that the components defined therein are much more likely to be
>available, since there is no reliance on a schema location mechanism to
>locate the schema.
>
>What the spec doesn't say, is whether inlined schemas are actually
>guaranteed to be available.  That is, the schema components in the
>WSDL+Schema component model must include at least those components
>defined in inline schemas, along with any components from imported
>schemas found by a schema location mechanism (which may be none).  Add
>of course the caveat that any processing that relies on a component that
>is not present will fail.
>
>I'm not sure whether this implied difference between imported and
>inlined schemas should be enhanced, or reduced.
>
>
>  
>
I fear this issue is being under confusions about schema inlining in 
WSDL. Consider the following example (I think that is what you are 
getting at too)

<foo>
    <xs:schema ...
       <xs:import namespace= ... schemaLocation="..."/>
    </xs:schema>
    ...
    <xs:schema ...
        <xs:import namespace= ... schemaLocation="...."/>
    </xs:schema>

</foo>

According to the schema spec, this is legal for schemas to appear 
embedded in documents where the schema is not the document root as you 
point out per section 4.3.1:

NOTE: there will often be times when a schema document will be a 
complete XML 1.0 document whose document element is <schema> 
<http://www.w3.org/TR/xmlschema-1/#element-schema>. There will be other 
occasions in which <schema> 
<http://www.w3.org/TR/xmlschema-1/#element-schema> items will be 
contained in other documents, perhaps referenced using fragment and/or 
XPointer notation.

Note that these two schemas in my example be importing each other, 
regardless of whether they are inlined within WSDL or not. So, I am 
trying to understand  why is this case is any different and why we need 
to do something special wrt schemaLocation in WSDL.

If i happen to use this document that contain these two schemas instead 
of inlining them in my WSDL, I should get the same semantics, nothing 
more nothing less. Would you agree?

BTW, please note that BP 1.0 rule happens to disallow importing of the 
schemas as they are defined in my foo document, as well, inlined or 
imported.

Cheers,

--umit



-- 
Umit Yalcinalp                                  
Consulting Member of Technical Staff
ORACLE
Phone: +1 650 607 6154                          
Email: umit.yalcinalp@oracle.com

Received on Friday, 24 October 2003 18:37:22 UTC