petweg
July 16th, 2002, 06:38 PM
Hi,
i use MSXML4.0 to read a XML document. But the parser seems not to validate the document against the specified schema.
I also can open the XML document with IE5.0, and the browser throws no error.
The TITLE element was renamed to TITLE2 in the XML document in order to produce an error, but why does this work anyway?
Any hints appreciated.
Bye
Peter
This is the XML document:
<?xml version="1.0"?>
<ROOT
xmlns="http://www.mytest.de/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:SchemaLocation="http://localhost/greatnet/dok.xsd">
<TITLE2>
Test
</TITLE2>
</ROOT>
This is the schema file on http://localhost/greatnet/dok.xsd:
<?xml version="1.0"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.mytest.de/"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<xsd:element name="ROOT">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="TITLE"
minOccurs="1"
maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
i use MSXML4.0 to read a XML document. But the parser seems not to validate the document against the specified schema.
I also can open the XML document with IE5.0, and the browser throws no error.
The TITLE element was renamed to TITLE2 in the XML document in order to produce an error, but why does this work anyway?
Any hints appreciated.
Bye
Peter
This is the XML document:
<?xml version="1.0"?>
<ROOT
xmlns="http://www.mytest.de/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:SchemaLocation="http://localhost/greatnet/dok.xsd">
<TITLE2>
Test
</TITLE2>
</ROOT>
This is the schema file on http://localhost/greatnet/dok.xsd:
<?xml version="1.0"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.mytest.de/"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<xsd:element name="ROOT">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="TITLE"
minOccurs="1"
maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>