Hi Folks,
I have an XML document and its corresponding Schema. While parsing it with the SAX2 Parser, I first of all get the error message that the specified grammar-"http://www.w3.org" - is not found. Then its unable to recognise the schema specified in the XML and hence flashes the error message for each element & attribute that it must be declared.
I would be very greatful if someone could help me find a solution.
I am using Xerces and writing the application in
Java.
For your reference I am giving the XML and Schema that is being used.
---------------
XML Document
---------------
<?xml version="1.0" encoding="UTF-8"?>
<Person xmlns="http://www.w3.org" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:SchemaLocation="C:\SchemaValidation\schema_test.xsd">
<RoleNo>XI-12</RoleNo>
<Age>12</Age>
</Person>
-----------------
XML Schema
-----------------
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://www.w3.org" xmlns="http://www.w3.org" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
<xsd:element name="Person">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RoleNo" type="xsd:string"/>
<xsd:element name="Age" type="xsd:short"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Hope for an immediate response.
Regards.
[This message has been edited by Lakshmi Ramachandran (edited June 28, 2001).]