CHAMPION KAY TUTORIAL

XML Validator


XML Errors Will Stop You

Errors in XML documents will stop your XML applications.
The W3C XML specification states that a program should stop processing an XML document if it finds an error. The reason is that XML software should be small, fast, and compatible.
HTML browsers will display documents with errors (like missing end tags). HTML browsers are big and incompatible because they have a lot of unnecessary code to deal with (and display) HTML errors.
With XML, errors are not allowed.

Syntax-Check Your XML

To help you syntax-check your XML, we have created an XML validator.
Paste your XML into the text area below, and syntax-check it by clicking the "Validate" button.


<?xml version="1.0" ?> 
<note>
<to>Tove</to> 
<from>Jani</Ffrom> 
<heading>Reminder</heading> 
<body>Don't forget me this weekend!</body> 
</note>

Note: This only checks if your XML is "Well formed". If you want to validate your XML against a DTD, see the last paragraph on this page.

Syntax-Check an XML File

You can syntax-check an XML file by typing the URL of the file into the input field below, and then click the "Validate" button:

Filename:

PLEASE ADOBE FLASH PLAYER REQUIRED:

Note: If you get an "Access denied" error, it's because your browser security does not allow file access across domains.
The file "note_error.xml" demonstrates your browsers error handling. If you want see an error free message, substitute the "note_error.xml" with "cd_catalog.xml".

Validate Your XML Against a DTD

If you know DTD, and you run Internet Explorer, you can validate your XML in the text area below.
Just add the DOCTYPE declaration to your XML and click the "Validate" button:


<?xml version="1.0" ?> 
<!DOCTYPE note [
  <!ELEMENT note (to,from,heading,body)>
  <!ELEMENT to      (#PCDATA)>
  <!ELEMENT from    (#PCDATA)>
  <!ELEMENT heading (#PCDATA)>
  <!ELEMENT body    (#PCDATA)>
]>
<note>
<to>Tove</to> 
<from>Jani</from> 
<heading>Reminder</heading> 
<message>Don't forget me this weekend!</message> 
</note>


0 comments:

Post a Comment