XML with correct syntax is Well Formed XML.
XML validated against a DTD or a Schema is a Valid XML.
Well Formed XML Documents
A "Well Formed" XML document has correct XML syntax.
A "Well Formed" XML document is a document that conforms to the XML syntax rules that were described in the previous chapters:
<?xml version="1.0" encoding="ISO-8859-1"?> <E-mail> <To>Rohan</To> <From>Amit</From> <Subject>Surprise....</Subject> <Body>Be ready for a cruise...i will catch u tonight</Body> </E-mail> |
A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD) or a XML Schema .
The following xml document is validated against a DTD , notice the highlighted text.
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE e-mail SYSTEM "InternalE-mail.dtd"> <E-mail> <To>Rohan</To> <From>Amit</From> <Subject>Surprise....</Subject> <Body>Be ready for a cruise...i will catch u tonight</Body> </E-mail |
A DTD defines the legal elements of an XML document. The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements.
XML Schema
XML Schema is an XML based alternative to DTD .W3C supports an alternative to DTD called XML Schema.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: XML Validation View All Comments
Post your Comment