aspose file tools*
The moose likes XML and Related Technologies and the fly likes well-formed and valid XML difference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "well-formed and valid XML difference" Watch "well-formed and valid XML difference" New topic
Author

well-formed and valid XML difference

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi All,

What is the difference between well-formed and valid XML ?

Thanks & Regards,
Kumar.


RR Kumaran
SCJP 1.4
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Well-formedness means that your XML structure is correct, you're not using illegal characters, etc. For example, the following document is not well-formed because the elements are not contained properly:

The validity of an XML document, however, is about the XML document complying with a given DTD or XML Schema document which describes what kind of tags are allowed, in what order, how many of them, what other elements can they contain, etc.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
 
subject: well-formed and valid XML difference