As indicated above, DDEX has published ISO/Schematron rules for recent ERN versions to its members. These Schematron files can be used to verify whether an ERN message conforms to the relevant profile.
They can be used in an XML editor in the same way as an XSD as long as the editor is able to handle XSLT2 and Xpath2 expressions. Most modern XML editors – such as Oxygen and XmlSpy – are XSLT2/Xpath2 compatible.
In Oxygen this can be done by clicking the downward triangle next to the XSD validation button (encircled in red in the diagram below), selecting “Validate with…” and entering the appropriate information into the relevant window:
Any Schematron error will, as with the XSD validation, allow the user to navigate to the offending location. And, as with XSD validation, a green box in the top right corner indicates that no Schematron errors were found.
Command Line (UNIX)
The Schematron validation can also be done from a command line or within an application. However, the process is a bit more complex and involves having a working XSLT processor capable of handling style sheets in version XSLT2 installed.
Below is the process for the Saxon processor. Schematron files are, in effect, XML Stylesheets (XSLTs) but they need to be prepared for the specific XSLT processor at hand. For Saxon this happens in three steps and involves calling a Java runtime environment as follows:
The output will be an XML file that can be parsed, for example, by grep, and if the string role="Fatal Error" does not occur, the file passes the validation.
Command Line (Windows)
For Windows systems the same procedure as for UNIX can be used and the two commands for generating the XSLT file ddex.xsl from the Schematron file and using it to test the file test_file.xml are as follows:
DDEX is in the process of developing and deploying an online tool that can be used to test messages.
The two screen shots below show a successful and an unsuccessful test. In each case, a log file containing all findings is generated. The script is provided in Annex A.
This is a Perl script calling the DSRF Validator discussed in Clause 3 to test whether a DSR file is in accordance with the relevant profile. The script, written for OS X, expects the variables