Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Valid vs. well-formed XML

 
Monoj Roy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic