I know that to validate a xml file we use a xsd file which also a xml file. How to validate this xsd file?
Asked
Active
Viewed 545 times
0
-
possible duplicate of [XML Schema to validate XML Schemas?](http://stackoverflow.com/questions/3996743/xml-schema-to-validate-xml-schemas) – Daniel Haley Feb 09 '15 at 16:34
-
The answers doesn't explain how it works. – Hunsu Feb 09 '15 at 16:37
1 Answers
0
You can use a tool like Liquid XML Studio to load and validate the XSD, this will provide a graphical representation of the XSD and take you to the errors.
If you want do do this in code then:
- .Net you could load the XSD into an XmlSchemaSet and hook the ValidationEventHandler event to look out for errors. Once your schemas are loaded compiling the schema set will shake out an last errors.
- COM Load it into MSXML, the parsers not the best so it will output some spurious errors.
- Java with Xerces create a XMLSchemaFactory and use this to create a schema object, creating a validator from the schema will result in the schema itself being validated.

Sprotty
- 5,676
- 3
- 33
- 52
-
You haven't understood my question. I xsd (xml file) to validate another xml file, now want to validate the xsd file so I must create another xsd file. Now if I want to validate this xsd file I must create another xsd. You see the recursion? – Hunsu Feb 10 '15 at 10:31