You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by rasco rasco <oc...@yahoo.it> on 2001/02/22 12:41:54 UTC
schema validation problem (shema file can not found).
hi all, i'm new in this mailing list.
I'm using xerces 1.2.3.
this is my simple schema
<xsd:schema
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlmns:per="http://localhost/~devel/per.xsd"
targetNamespace="http://localhost/~devel/per.xsd">
<xsd:element name="listaNomi">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="per:persona"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="persona">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nome" type="xsd:string" />
<xsd:element name="cognome" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
this is my very simple xml file:
<?xml version="1.0"?>
<listaNomi
xmlns="http://localhost/~devel/per.xsd"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:schemaLocation="http://localhost/~devel/per.xsd">
<persona>
<nome>luca</nome>
<cognome>rasconi</cognome>
</persona>
</listaNomi>
when i try to validate the xml file, application teel
me:
'General Schema Error: Grammar with uri 2:
http://localhost/~devel/per.xsd , can not found'
and, as consequence, that all the elements must be
declared.
what's the problem?
thank in advance.
______________________________________________________________________
Do You Yahoo!?
Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it
Re: schema validation problem (shema file can not found).
Posted by Ian Roberts <ir...@decisionsoft.com>.
On Thu, 22 Feb 2001, rasco rasco wrote:
> <listaNomi
> xmlns="http://localhost/~devel/per.xsd"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xsi:schemaLocation="http://localhost/~devel/per.xsd">
The schemaLocation attribute should read:
"http://localhost/~devel/per.xsd http://localhost/~devel/per.xsd"
It associates the namespace URI with the location URL of the schema (in
this case they are both the same, but both still need to be given).
Ian
P.S. These questions would be better posted to the xerces-j-user mailing
list.
--
Ian Roberts, Software Engineer DecisionSoft Ltd.
tel: +44-1865-203192 http://www.decisionsoft.com