OxygenValidation

From NGDCWiki

Jump to: navigation, search

It is important to ensure that the metadata is valid BEFORE posting to SVN.

  • Well formed XML
  • Schema Valid (XSD)
  • Schematron Valid
  • Contains only ASCII characters

Contents

Well Formed XML

Format and Indent Icon
Format and Indent Icon
Format and Ident Result
Format and Ident Result

The metadata file must be well formed XML.

  1. XML documents must contain a unique opening and closing tag that contains the whole document, forming what is called a root element.
  2. All other tags must be nested properly, i.e. there must be an opening and a closing tag and the tags cannot overlap.
  3. Tags in XML are case sensitive

A quick way to check this in Oxygen is to format and indent the file when it is open. This action fails when the XML is not well formed.

Schema Validation

Schema validation will compare the xml tags to the rules and definitions for each element published in the standard.
When a schema is associated to the XML file - Oxygen will validate the XML against the standard and provide a list of available metadata elements while editing.

Schema validation will:

  1. Test for the presence or absence of mandatory fields
  2. Test for correct datatype of particular elements, e.g. the pubdate tag may only contain a date value that is formatted like 20081031
  3. Test the order of tags

Schema validation will NOT:

  1. Test for missing 'conditional' or 'mandatory if applicable' fields are missing
  2. Check validity of URLs or email addresses
  3. Spell check


Associating ISO Schemas

  1. Open an ISO metadata file
  2. Select Associate Schema icon and pop-up box will appear
  3. Select XML Schema tab and copy/past this URL to the schema: http://www.ngdc.noaa.gov/metadata/published/xsd/schema.xsd
  4. Select OK
  5. The root element of your ISO metadata should now contain a schemaLocation declaration:
  6. ISO also requires that all applicable namespaces are declared -
<gmi:MI_Metadata
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:srv="http://www.isotc211.org/2005/srv" 
xmlns:gml="http://www.opengis.net/gml/3.2" 
xmlns:gsr="http://www.isotc211.org/2005/gsr" 
xmlns:gss="http://www.isotc211.org/2005/gss" 
xmlns:gts="http://www.isotc211.org/2005/gts" 
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gmi="http://www.isotc211.org/2005/gmi" 
xsi:schemaLocation="http://www.isotc211.org/2005/gmi http://www.ngdc.noaa.gov/metadata/published/xsd/schema.xsd"> 

Associating FGDC Schemas

Associate Schema Icon
Associate Schema Icon
  1. Open an FGDC metadata file
  2. Select Associate Schema icon and pop-up box will appear
  3. Select XML Schema tab and copy/past this URL to the schema: http://www.ngdc.noaa.gov/metadata/published/xsd/ngdcSchema/schema.xsd
  4. Select OK
  5. The root element of your FGDC metadata should now look like this:
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="http://www.ngdc.noaa.gov/metadata/published/xsd/ngdcSchema/schema.xsd">

Validating

Indicators of Valid Document
Indicators of Valid Document
Indicators of Invalid Document
Indicators of Invalid Document

Things to look for when a metadata record is not valid:

  1. Red box in the upper right corner
  2. Red lines along the right side
  3. Red squiggly lines underneath the element where validation message occurs
  4. Error Message Box

Testing for Non-ASCII Characters

Non-ASCII characters such as microsoft curly quotes could cause unusual problems in xml, especially when translating to HTML.

You can set the encoding to ascii in the XML declaration of the metadata record.

<?xml version="1.0" encoding="ascii"?>

This causes Oxygen to enforce a strict adherence to ascii characters only and the tool will not let you save a metadata record. Further more, the pop-up error box message will tell you where in the record this non-ascii character resides.

How to FIX Errors

Validation Error Guidance on NOAA Environmental Data Management Wiki

Personal tools