footh <[EMAIL PROTECTED]> wrote on 03/16/2007 07:52:27 PM:

> Take this wsdl:
> 
> http://www.nws.noaa.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php?wsdl
> 
> Notice in the schema section there are two import
> statements with namespace attributes, but no
> schemaLocation attributes.  This is perfectly legal
> per the XML Schema spec.
> 
> However, when using the XMLGrammarPreparser to
> preparse the schema, the following error is generated
> twice (once for each import):
> 
> schema_reference.4: Failed to read schema document
> 'null', because 1) could not find the document; 2) the
> document could not be read; 3) the root element of the
> document is not <xsd:schema>.

Are you sure you're not just getting a warning message? Xerces will report 
one if it cannot locate [1] a schema document for an import after:

1) querying its local cache; then
2) querying the grammar pool if one was registered; then
3) querying the entity resolver if one was registered; then
4) dereferencing the schema location hint if one was provided.

If no schema document is found after all these steps, it's *not* an error.

> Presumably, the code is looking for the schemaLocation
> attribute, not finding it and instead trying to find
> 'null'.  I'm thinking this could be a bug, but I may
> be doing something wrong.  Can anyone offer any input
> or suggestions?

The message just isn't very informative. This isn't a bug, but it 
certainly could be improved.

If you want these imports to resolve you should register an entity 
resolver which locates a schema document based on the target namespace 
(and possibly other information provided in the XMLSchemaDescription).

> Thanks,
> 
> JBF
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

[1] http://www.w3.org/TR/xmlschema-1/#schema_reference

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to