Xerces defers the loading of schemas. That is, a schema is loaded only when
something from its target namespace is required. In your case, your xsd
file will only be read if the namespace "
http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2
" is referenced. I don't think it's referenced, because there is even no
namespace declaration for that namespace.

I also planned to reply your other mail. Here it goes:

> 1a) I did _NOT_ see any attempt to retrieve the SOAP schema, as
> specified by the root element  attribute:
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";

Schema locations are specified using one of the xsi schema location
attributes, like what you did for the MM7 schema. A namespace declaration
like the above doesn't mean the parser needs to retrieve a schema for that
namespace, not to mention that the parser doesn't know where to retrieve
such schema.

To fix it, add an xsi:schemaLocation attribute for this namespace. So the
result would something like:
xsi:schemaLocation="mm7_namespace mm7.xsd soap_namespace soap.xsd"

This is also the reason why you are seeing the cvc-elt error. You didn't
provide a location for the soap namespace, so Xerces couldn't find a
declaration for your root element.

> Are you also saying that Xerces _can_ do Schema validation _without_ DTD
> validation

If there is no DTD in your instance, then Xerces only does schema
validation. But if you do have a DTD, Xerces validates the instance against
both kinds of grammars. This is not correct as per JAXP. We'll fix it so
that when schemaLanguage==xmlschema, no DTD validation is performed.

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                
                                                       
                      "Jesus M. Salvo                                           
                                                       
                      Jr."                     To:       [EMAIL PROTECTED]      
                                            
                      <[EMAIL PROTECTED]        cc:                             
                                                        
                      sia.com>                 Subject:  Re: Expecting no 
namespace, but the schema document has a target namespace    
                                                                                
                                                       
                      01/13/2003 06:05                                          
                                                       
                      PM                                                        
                                                       
                      Please respond to                                         
                                                       
                      xerces-j-user                                             
                                                       
                                                                                
                                                       
                                                                                
                                                       




Sandy,

Thanks for the reply, but ....

I just changed the my SOAP envelope so that the root document is now, as
you have suggested, like this:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xsi:schemaLocation=

"
http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2


http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2.xsd
">


But the problem now is it does not even seem to try or perform a schema
validation.
Running a sniffer, no attempt has been made by the parser to retrieve
the schema document from www.3gpp.org.
But I do still get the following error, also reported on my original post:

Error: URI=null Line=8: cvc-elt.1: Cannot find the declaration of
element 'SOAP-ENV:Envelope'.


The only way I could achieve some level of schema validation is by using
xsi: noNamespaceSchemaLocation, as mentioned in here:

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM9.html

I would prefer declaring the schemas in the XML document itself ...
rather than assigning them by code.

Any ideas?

Thanks

John


[EMAIL PROTECTED] wrote:

>In your instance document:
>
>
>
>>xsi:noNamespaceSchemaLocation="
>>
>>
>http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2.xsd

>">
>
>which means that your xsd file doesn't have a target namespace. But in
your
>schema:
>
>
>
>>targetNamespace
>>
>>
>="
http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2
"
>
>
>A contradiction!  So Xerces is right in reporting an error.  To fix it,
>instead of using xsi:noNamespaceSchemaLocation, use xsi:schemaLocation,
>like this:
>
>xsi:schemaLocation="
>http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2

>http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2.xsd

>"
>
>Cheers,
>Sandy Gao
>Software Developer, IBM Canada
>(1-905) 413-3255
>[EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>


--
Jesus M. Salvo Jr.
Mobile Internet Group Pty Ltd
(formerly Softgame International Pty Ltd)
M: +61 409 126699
T: +61 2 94604777
F: +61 2 94603677

PGP Public key:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348



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





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

Reply via email to