• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

well formed vs Valid documents

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i would like to know all the differences between the above two.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The difference is actually quite simple.
A well-formed XML document is one which fully adheres to the syntax of XML. This includes things like all tags are closed, tags are properly nested (ie <a><b>blah</b></a> ) and don't cross
over (ie not <a><b>blah</a></b> ), all contentious ('<' '>' '&' ''') characters are escaped and so on.
A valid XML document is one which is well-formed, but also correctly implements its specified DTD.
Both are useful; You don't always want the overhead of DTD checking, and many XML tools are generic enough that they will work on any well-formed XML, regardless of DTD. On the other hand, it is often vital to make sure that some XML is valid against the required DTD before starting expensive processing.
Some available parsers provide validity checking, but some only check for well-formed XML. Make sure that the parser you chose does what you need.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic