Hi Dale,

EXT-Pennington, Dale K <[EMAIL PROTECTED]> writes:

> 1) Lack of include file. While I get a nice complaint is the initial
> schema file does not exist, if it includes a file :
>     <include schemaLocation="a.xsd"/>
> and a.xsd does not exist, I get no complaints.

The XML Schema spec says that the schemaLocation is only a hind to
the parser about where the schema might be. The schema file can also
be provided by other means (e.g., by calling loadGrammar). As a
result, Xercec-C++ issues a warning when included/imported schemas
are not found. You can see it if you override handleWarning in
ErrorHandler.

You can also provide your own entity resolver which can make
this an error.


> 2) Lack of elements. The schemas I have inherited tend to be defined as
> :
>    <xs:element name = "a">
>       <xs:complexType>
>          <xs:sequence>
>             <xs:element ref="b">
>             <xs:element ref="c">
>          </xs:sequence>
>       </xs:complexType>
>    </xs:element>
>    <xs:element name="b" type="xs:boolean"/>
>    <xs:element name="c" type="xs:integer"/>
>
> All well and good. But if I comment out the element b and c definitions,
> but leave in the element refs in the definition of a, I get no grammar
> loading complaints, although I do get a error during xml parsing saying
> b is not defined.

I just tested your example and I get an error saying that referenced
element is not found. Can you make sure you set the error handler
before calling loadGrammar? If this does not help, can you provide
a small test case that illustrates the problem?


Boris

-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

Reply via email to