Difference between revisions of "XML Validation"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |
(No difference)
|
Latest revision as of 16:34, 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.