W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2013

Included <schema>

From: George Cristian Bina <george@oxygenxml.com>
Date: Tue, 12 Feb 2013 11:48:00 +0200
Message-ID: <511A0FD0.2010809@oxygenxml.com>
To: xmlschema-dev@w3.org

I always thought that an included schema document may refer to 
components that are defined in the including <schema> even if they are 
not directly reachable if we start from the included schema.

More clearly the following sample should be valid:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:include schemaLocation="m.xsd"/>
   <xs:element name="root">
       <xs:sequence maxOccurs="unbounded">
         <xs:element ref="content"/>
   <xs:element name="a" type="xs:string"/>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
   <xs:element name="content">
       <xs:sequence minOccurs="0">
         <xs:element ref="a"/>

Now, the spec says in http://www.w3.org/TR/xmlschema-1/#src-include:
Schema Representation Constraint: Inclusion Constraints and Semantics
In addition to the conditions imposed on <include> element information 
items by the schema for schemas, all of the following must be true:
1 If the ·actual value· of the schemaLocation [attribute] successfully 
resolves one of the following must be true:
1.1 [...]
1.2 It resolves to a <schema> element information item in a well-formed 
information set, which in turn corresponds to a valid schema.

Does this "which in turn corresponds to a valid schema" mean that the 
above schema starting from test.xsd should be considered invalid because 
m.xsd is not valid itself?

Neither Saxon EE nor Xerces report problems when validating test.xsd so 
my guess is that there is some other place in the spec that allow this 
case and maybe the "corresponds to a valid schema" here does not mean 
that the module itself is a valid schema but that all the modules that 
define components in the same namespace should form a valid schema.
Anyway, I will appreciate some insight into this.

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
Received on Tuesday, 12 February 2013 09:48:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:21 UTC