• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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.
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic