Difference between revisions of "XML Validation"

From Ittichai Chammavanijakul's Wiki
Jump to navigation Jump to search
(Created page with "The <b>xmllint</b> tool can be used to validate XML documents against DTDs and XML Schema definitions. It can be downloaded as a part of the free, open-source libxml2 package at ...")
 
Line 21: Line 21:
 
* W3C Markup Validation Service for DTDs
 
* W3C Markup Validation Service for DTDs
 
* XML for ASP.NET Schema Validator for XML Schema.
 
* XML for ASP.NET Schema Validator for XML Schema.
 +
 +
[[Category: XML, XML Tools]]

Revision as of 16:12, 16 November 2011

The xmllint tool can be used to validate XML documents against DTDs and XML Schema definitions. It can be downloaded as a part of the free, open-source libxml2 package at http://xmlsoft.org/xmldtd.html.

These are some examples of using the xmllint command.

To validate XML data with a DTD stored in the same file:

 xmllint --valid --noout DataFileWithDTD.xml


To validate XML data against a separately stored DTD:

 xmllint --dtdvalid DTD.dtd --noout DataFileWithoutDTD.xml


To validate XML data against a separately stored XML Schema definition:

 xmllint --schema XMLSchemaFile.xsd --noout DataFile.xml


Alternatively, the following online services can also be used to validate XML:

  • W3C Markup Validation Service for DTDs
  • XML for ASP.NET Schema Validator for XML Schema.