I am new to XML I want to clear my some doubts how I can parse my xml file,I have created my own xml and dtd file.I have heard that there is only two ways of parsing xml file is it right ? if it is right then what are the two ways ?
You're probably talking about
SAX and
DOM. SAX is an event-based approach to parsing (i.e. the XML parser sends your application
events when encountering elements, attributes, text nodes, etc.) while DOM is a document-based approach (the XML parser builds a complete document object hierarchy for you to navigate and pick the info you need).
Another question is validation and parsing are same thing ?
No. Parsing is the act of transforming a character stream/file/string/whatever into an XML document while validation is the act of checking that the resulting document follows the structure it should follow (i.e. compare the XML document to its DTD document).