Possible Duplicate:
Java API to parse XSD schema file
I have a requirement to parse my XML schema file which will be in .xsd extention.
I am familiar with SAX parser , So I want to use this parser to parse my schema , but I read it in forums that I can’t parse my XSD file usind SAX parser.
Please let me know which parser/API I need to use to parse my XSD file.
The
*.xsdformat is perfectly well-formed XML, and so you can indeed parse an XML schema file with a SAX parser.Now, why you’d do that is another story. Usually what you want to do is validate that an XML file adheres to the schema described in the
*.xsdfile; you do that by referencing the schema in the XML file and setting the appropriate properties on the parser factory: it doesn’t involved parsing the schema file explicitly yourself.