Please visit our sponsors !
XML Validation
XML with correct syntax is Well Formed XML.
XML validated against a DTD is 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"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
|
"Valid" XML documents
A "Valid" XML document also conforms to a DTD.
A "Valid" XML document is a "Well Formed" XML document, which
also conforms to the rules of a Document Type Definition (DTD):
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note SYSTEM "InternalNote.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
|
XML DTD
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. You can read more about DTD,
and how to validate your XML documents in our DTD tutorial.
XML Schema
XSchema is an XML based alternative to DTD.
W3C supports an alternative to DTD called XML Schema. You can read more about
XML Schema in our Schema tutorial.
Errors will Stop you
Errors in XML documents will stop the XML program.
The W3C XML specification states that a program should not continue to
process an XML document if it finds a validation error. The reason is that XML
software should be easy to write, and that all XML documents should be
compatible.
With HTML it was possible to create documents with lots of errors (like when
you forget an end tag). One of the main reasons that HTML browsers are so big
and incompatible, is that they have their own ways to figure out what a document
should look like when they encounter an HTML error.
With XML this should not be possible.
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|