This is the second in a series of blog posts aimed at documenting the development of an XCRI-CAP 1.2 validator. The entire series can be found by visiting the validator blog post list. My aim is to post a new blog post every week until the development is complete, then at least once every month to document both the usage of the validator as well as any community-highlighted modifications or issues.
In this blog post I have decided to concentrate on the top-level structure of the validation routine with the aim for users to understand the basic terminology used and how it fits within the project as a whole. The validator library is built as a .NET 4 library using C# and builds upon the base validation functionality exposed by the .NET library itself.
Validation of an XCRI-CAP 1.2 feed is done in three separate ways: by ensuring the document is a valid XML document, that the XML document is valid according to the XML schemas involved, and that the XML document passes some additional rule-based validation. At each level, each exception captured by the document is presented back to the user along with guidance on how to resolve the issue.
- The first level of validation ensures that the document itself is a valid XML document. This captures issues such as incorrectly escaped characters like ">" and "<" within the document, incorrect tag nesting and undeclared namespace prefix issues.
- The second level of validation ensures that the document is valid according to the XML Schemas that it references. The XML Schema itself for XCRI-CAP 1.2 can be found on and the XCRI.co.uk website (note, though, that the XML Schema documents are interpretations of the specification not the specification itself - the specification is found on the XCRI wiki). This level of validation highlights, for example, invalidly used elements or elements that are used that are in the wrong namespaces.
- The third level of validation runs various validation rules over the document to ensure both compliance with the specification (above and beyond that enforced by the XML Schemas), and to aim to ensure a consistency of information within the feed itself. can be found within the .
The rule base used in the validation is fed in from both the official XCRI-CAP 1.2 standard, through guidance issued via associated JISC-funded projects, and through the wider XCRI-CAP community.
The XCRI-CAP 1.2 validation library and an online tool to validate feeds are expected to be completed by the end of February 2012.