Hello, I am struggling to find out how can I can I make use of the XML schema, when I parse my XML document with SAX parser. I have to need to find out types and constrainsts of the elements which are defined in XML schema of the XML document. I am kinda thinking I have to write XML schema parser as well. Any thoughts or suggestions will be appreciated. Regards, Akhtar
The schema document can be used to validate the XML document while parsing. It's basically invisible to you except for the parse() method throwing a SAXParseException if the XML instance doesn't conform to the specified XML Schema. Take a look at HowToValidateXmlAgainstAnySchema in our wiki.
yeah. parsing and validating are two different things. if you just want to get straight to the core of what's *in* a (perhaps valid) dtd, and passively perform some lightweight validation along the way - don't write your own parser, try something like wutka's or bourret's dtdparser first. Likewise there are articles about perl/php versions of this (if your box has php) at webreference or zend (expat). hth