Well Fiormed XML conforms the Syntax that is tag should be nested etc .. Valid XMl : If the XML also follow the rules of DTD,Schema then it is Valid XML. Now why we need the two types of XML why we always not use Valid one or how to choose in my application which type of XML I should use ?
Can anybody give an Example what parameters I should check before going for a particular type of XML ?
Well-formed just ensures an XML parser can parse the document. Valid usually means an application can use the parsed XML.
For example, you could have an application that accepts messages in XML to do a specific tasks. For this, you could design an XML structure like:
In order that message senders know how to structure their XML message you could provide a schema. To make sure your message processing applicaiton can work with an incoming XML message the first thing it could do is validate it against the schema and throw away any that don't conform.