xml| Tutorials | Getting Started
XML with the correct syntax is a good form of XML.
XML that is validated with some kind of DTD is legitimate XML.
Make a good XML document
A "well-formed" XML document has the correct syntax.
A "W-well-formed" XML document follows the XML syntax rules described in the previous chapters:
- The XML document must have a root element
- The XML document must have a close tag
- XML tags are case sensitive
- XML elements must be nested correctly
- XML attribute must be quoted
<?xml version= "1.0" encoding= "iso-8859-1"? ><note><to>tove</to><from>jani</from >
Validating an XML document
A legitimate XML document also complies with a DTD.
A legitimate XML document is a "well-formed" XML document that also adheres to the syntax rules of the document type definition (DTD):
XML DTD
A DTD defines the legitimate elements of an XML document.
The role of DTDs is to define the legitimate building blocks of XML documents. It uses a range of legitimate elements to define the document structure. You can get more information about DTDs in our DTD tutorial, and how to validate XML documents.
XML Schema
An XML Schema is an xml-based DTD substitute.
The consortium supports a standard named XML Schema as an alternative to DTDs. You can get more information about XML schemas in our XML Schema tutorial.
A generic Validator
To help you examine the syntax of the XML file, we created this tool so that you can check any XML file for syntax.
XML error will terminate your program
Errors in the XML document will terminate your XML program.
The XML specification declaration of the Consortium: if there is an error in the XML document, then the program should not continue to process the document. The reason is that XML software should be easy to write, and that all XML documents should be compatible.
If you use HTML, it is possible to create a document that contains a large number of errors (for example, you forget an end tag). One of the main reasons is that HTML browsers are pretty bloated and poorly compatible, and they have their own way of determining what the document should look like when it finds an error.
With XML, this should not be the case.
Syntax checking of your XML-only for IE browsers
To help you with the syntax checking of XML, we created an XML validator using Microsoft's XML parser.
Paste your XML into the following text box, and then click the "Verify" button to check the grammar.