Search code examples
xmlxsdxsd-validationxml-validation

How do I control data compliance once my XML schema is ready?


It might sound like a silly question, but for people outside the software industry, it is not so easy to figure out:

Once I have created a data standard with my XML schema, how do I control the correctness of the data (for instance XML files). Should I use particular packages in some specific programming language to discriminate compliant files from non-compliant? Or do I need to translate my schema in something else, for instance JSON schema ?


Solution

  • The process of determining whether an XML document complies with an XML schema is called validation. There are open source and commercial validating parsers which will report whether and how an XML document violates the grammar and vocabulary specified in an XML schema.

    You do not need to translate your XSD. You do not need to write additional software, unless you wish to enforce additional constraints not expressed in your XSD.

    An XSD cannot directly validate JSON, however see Validate JSON against XML Schema (XSD).