I am having similar problems getting schema validation going with xerces 1.4.0.
My xml declaration is:
 
<JavaXML:Book xmlns:xsi='http://www.foobar.com/xmlsch'
    xsi:schemaLocation='http://www.foobar.com/xmlobj http://shekar.epiphany.com/JavaXML.xsd'
          xmlns:JavaXML='http://www.foobar.com/xmlobj'>
My schema declaration has:
 
<schema
  targetNamespace='http://www.foobar.com/xmlobj'
  xmlns='http://www.foobar.com/xmlsch'
  xmlns:JavaXML='http://www.foobar.com/xmlobj'>
Validation fails with
[Error] java.xml:5:56: General Schema Error: Grammar with uri 2: http://www.foobar.com/xmlobj , can not be found.
 
(Only the reference to JavaXML.xsd is a real URL, obviously. Also, I have the validation, schemasupport and namespace
support features turned on in the parser.)
 
Thanks in advance for any help.
 
Best,
--Sridhar
 
-----Original Message-----
From: Anderson, John [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 06, 2001 7:35 AM
To: '[EMAIL PROTECTED]'
Subject: RE: problem starting validation

You seem to be trying a mix of namespaced and non-namespaced stuff.
 
If your schema has a targetNamespace, I think you MUST declare it in the document:
 
<Auftrag
    xmlns='targetNamespaceURI'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xsi:schemaLocation="targetNamespaceURI http://localhost:8090/test/Auftrag.xsd"   
>
 
If it has no targetNamespace then the first one should work.
 
Hard to tell without seeing the ns decs in your schema.
 
John
-----Original Message-----
From: Filkorn Roman [mailto:[EMAIL PROTECTED]
Sent: 06 June 2001 16:06
To: [EMAIL PROTECTED]
Subject: problem starting validation

Hi,
 
I am trying to use schema validation, have a problem and mail archives are down. Please, help me solve this simple problem:
 
<Auftrag
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://localhost:8090/test/Auftrag.xsd"
 
 Auftrags_Nummer = "ZP999549"
>
...
 
returns just that Auftrag is not declared.
 
 
<Auftrag
    xmlns='http://localhost:8090/test/Auftrag.xsd'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>
...
 
returns:
    Grammar with uri : http://localhost:8090/test/Auftrag.xsd , can not found.
    and that Auftrag is not declared...
 
 
In Internet Explorer that address (URI) properly loads requested schema. What am I doing wrong ? (Local addresses do the same, and are not supported, are they ?)
 
 
Thank you for any hint,
 
Roman Filkorn
 

Reply via email to