Validating MODS

From UA Libraries Digital Services Planning and Documentation
Jump to: navigation, search

When you run makeMODS.pl to generate MODS from your tab-delimited UTF8 spreadsheet, the script will generate a manifest.xml file in the directory where the spreadsheet is located. It will be named for the spreadsheet, for example: u0001_2011012.12.m01.txt will have a manifest named u0001_2011012.12.manifest.xml. For remediated MODS, see the manifestMods script to create the manifest used in XMLSpy. In this file are links to each of the MODS files, so:

YOU MUST VALIDATE THE MODS BEFORE YOU MOVE THEM!!

1) Right click on this XML file and select to open it with XMLSpy.

2) At the top of the XMLSpy window, click on XSL/XQuery and select XSL Transformation from the top of the dropdown list

HowToValidateBatch.png

3) XMLSpy will read the manifest (which contains a list of identifiers and links to each MODS file) and will test each one against the MODS_full_check.xsl in S:\\Metadata\Code\Schematron\. It will also validate each file.

4) When it has finished, an XSL Output.txt file will pop up with notes of problems found with each identifier (if no notes follow the identifier -- and the MODS file isn't listed at the bottom saying it's not valid, it's fine.)

ValidationOutputInfo.png

5) Also when it has finished, if any of the MODS failed to validate, that will show up in the bottom center window of XMLSpy, with a message such as:

  File:S\Digital Projects\Completed\u0002_0000006_0001993.mods.xml is not valid
  Reason:  The following elements are expected at this location(see below)

a) If this happens, either there was something unexpected or missing in the spreadsheet -- or something happened with the script.

b) Review the spreadsheet to look for what might be different

c) Contact someone who maintains this script.



6) If XMLSpy hangs, it's usually due to a non-UTF8 character in one of the files. When it hangs, a window will pop up that says "MODS_Schematron.xsl" at the top, and in the window at the bottom of the XMLSpy screen, you'll see a message such as

 "Cannot retrieve resource file:///S/:/Digital Projects/Completed/u0002_0000006/Metadata/MODS/u0002_0000006_0002011.mods.xml" 

Utf8problemInValidation.png


a) open the offending MODS file in XMLSpy. You will get a message such as "Your file contains 1 character(s) that should not be present in a file using the Unicode UTF-8 encoding. If you proceed, these characters will be replaced by a substitution character in the document window. Do you wish to continue opening the document?"

BadCharXMLspy.png

b) Click "OK".

c) Save the file and close it.

d) Close the Schematron window.

e) Go back to Step 2 above and continue.


7) When validation is complete, and all errors corrected, you're ready for upload.

Personal tools