naveenKurella
November 17th, 2003, 02:08 AM
I have XML file which is referring to .xsd file. whenever the .xml file is viewed in internet explorer, as it should check for the validation of .xsd file.
I removed .xsd file from the location which the .xml file is referring and then tried to open .xml file in Internet Explorer. No error message is given and opened nicely. as it supposed to give .xsd file is not found.
Can u give me solution for the above problem, how to validate .xml file against .xsd file, while opening the xml file. The fallowing are the XML file and XSD file which I used.
XSD file
=======
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com"
elementFormDefault="qualified"><xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>
XML file
=======
<?xml version="1.0"?>
<note xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="c:\note.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
I removed .xsd file from the location which the .xml file is referring and then tried to open .xml file in Internet Explorer. No error message is given and opened nicely. as it supposed to give .xsd file is not found.
Can u give me solution for the above problem, how to validate .xml file against .xsd file, while opening the xml file. The fallowing are the XML file and XSD file which I used.
XSD file
=======
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com"
elementFormDefault="qualified"><xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>
XML file
=======
<?xml version="1.0"?>
<note xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="c:\note.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>