File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Product and Other Certifications and the fly likes Valid vs. well-formed XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Valid vs. well-formed XML " Watch "Valid vs. well-formed XML " New topic

Valid vs. well-formed XML

Monoj Roy
Ranch Hand

Joined: Oct 10, 2007
Posts: 98
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 ?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

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.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
jQuery in Action, 3rd edition
subject: Valid vs. well-formed XML
It's not a secret anymore!