Sun MSV

The Sun Multi-schema Verifier is a library that validates XML documents against several types of schemas. It is maintained by Kohsuke Kawaguchi, a Sun employee, but it does not appear to be included in Java or JAXB.

MSV can be run as a command line utility or called as library functions.

It requires the schema definition file as input, along with the XML file to validate. For eLandings, this will require that all schema definition files for different version number are available, and custom code will need to be written to parse the XML file to determine the version to use.

MSV does not format the XML file before verifying it. Therefore, if the XML file does not include newline characters the messages will always refer to line 1. This is not convenient when displaying the XML back to the user.

The error messages include the line and column of the location of the error. However, the column number is the position after the closing tag of the element that caused the problem, so custom code would need to be written to locate the actual text causing the problem if it is to be displayed or highlighted.

Examples of output:

LR22722.xml - disposition code data not entered

<disposition_code></disposition_code>

Error at line:1, column:2,523 of file:///C:/tmp/msv-20081113/LR22722.xml
  Content of element "disposition_code" is incomplete

the document is NOT valid.

ProductionReport_ID_58490.xml - invalid gear code

<gear>PTR  </gear>

Error at line:1, column:393 of file:///C:/tmp/msv-20081113/ProductionReport_ID_58490.xml
  "PTR" does not satisfy the "integer" type

the document is NOT valid.

LR27454.xml - missing elements

<last_delivery_for_trip></last_delivery_for_trip>...<stat_area></stat_area>

Error at line:1, column:566 of file:///C:/tmp/msv-20081113/LR27454.xml
  Content of element "last_delivery_for_trip" is incomplete

Error at line:1, column:1,452 of file:///C:/tmp/msv-20081113/LR27454.xml
  Content of element "stat_area" is incomplete

the document is NOT valid.

However, some files that have known problems, such as Pr58497.xml with extraneous spaces, validate without errors.