W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2001

Re: XML Schema Implementation

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 21 Sep 2001 11:07:29 +0100
Message-ID: <092914443.20010921110729@jenitennison.com>
To: "Hanumaiahgari, Srinivas" <Srinivas.Hanumaiahgari@dva.gov.au>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi Srinivas,

> not getting how to validate my xml file against the schema. Used
> apache parser which supports W3C schema. Getting the following
> error.
>
> Recoverable Error: Attribute "xsd:noNamespaceSchemaLocation" must be
> declared for element type "SupplierInvoice".
> (file:///C:/binusha/SupplierInvoice.xml:10,51) SupplierInvoice
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
> seems to be problem with directing the location of xsd file to the
> xml file.

It could be that the URL that you're using in the
xsi:noNamespaceSchemaLocation attribute can't be resolved properly.
Since the XML instance and schema are in the same directory, rather
than use the absolute URL, try using a relative URL:

<SupplierInvoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:noNamespaceSchemaLocation="finalSchema.xsd">
...
</SupplierInvoice>

Or try changing the path that you use into a proper URL:

<SupplierInvoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="file:///C:/binusha/finalSchema.xsd">
...
</SupplierInvoice>

Alternatively, perhaps Xerces was objecting to the fact that it
couldn't find an element declaration for the SupplierInvoice element.
Try adding:

<xsd:element name="SupplierInvoice" type="SupplierInvoiceType" />

at the top level of the schema.

With this added, XSV throws up some other errors in the schema, such
as the fact that you're using the maxLength facet on various numerical
data types where it's not permitted. It might be that you have to
correct those as well, in case Xerces is actually complaining about
the validity of the schema.

I hope that you manage to get it working,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 21 September 2001 06:06:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:53 UTC