How to read Validator in XML

In this article i am going to explain about validator in XML
  • 2009

Definition

XML validator is used for syntax check in XML documents. The validator will report fatal errors, non-fatal errors and warnings. You may also validate an arbitrary XML document on the Web by typing its URL into the URL field.XML documents will stop your XML applications in error conditions.

Lets take an example of XML Validator

Syntax-Check Your XML

<?xml version="1.0" ?>
<note>
       <to>Jitendra</to>
       <from>
              Rohan</Ffrom>
              <heading>Message</heading>
              <body>Don't forget me this weekend!</body>
       </note>

output

Clipboard01.jpg

Validate Your XML Against a DTD


<?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>Jitendra</to>
       <from>Mukesh</from>
       <heading>Warning</heading>
       <message>Don't forget me this weekend!</message>
</note>

 

output

Clipboard02.jpg

Further Readings

You may also read more about XML here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.