Saturday, October 3, 2015

Validating XML against an XSD with xmllint

Quick reference for how to validate an XML document against a schema using xmlint:
  $ xmllint --noout --schema stats.xsd example-stat.xml 
  example-stat.xml validates
Here is what you might see for an invalid document:
  $ xmllint --noout --schema stats.xsd junk.xml
  junk.xml:1: element event: Schemas validity error : Element 'event': No matching global declaration available for the validation root.
  junk.xml fails to validate

2 comments:

  1. very informative article.And very well explained about different protocols.keep posting like good content posts.For more details please visit our website.

    Oracle Fusion Training Institute

    ReplyDelete
  2. The blog is very useful and informative which provides great information and I really loved it.CHECKPOINT R80.20 CCSA TRAINING

    ReplyDelete