Siddhartha said:
Hi,
If XML can be validated by either DTD or Schema and Schema itself is a XML.
How can we validate a Schema ?
There is no complete XML Schema defining the XML schema however the
schema processors usually validate a schema when you load it. For
instance with MSXML 4 you can ask a schema to be validated when you add
it to the schema cache. Consider the following schema with a typo (type
mistyped as typ):
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema">
<xs:element name="GOD" typ="xs:string" />
</xs:schema>
When you load that schema with MSXML e.g. with
var schemaCollection = new ActiveXObject('Msxml2.XMLSchemaCache.4.0');
schemaCollection.validateOnLoad = true;
try {
schemaCollection.add('', 'test20030815Xsd.xml');
}
catch (e) {
alert(e.description);
}
then an exception is caused an the alert shows that the attribute typ is
not supported.