ISO xPaths

From NOAA Environmental Data Management Wiki

The XPath specification provides a mechanism for selecting nodes from an XML document. It allows specification of entire paths and includes wildcards for abbreviating some elements. In ISO metadata these wildcards can be used at places where some choice exists or in place of abstract objects in paths.

gmd:MD_Metadata or gmi:MI_Metadata: The ISO metadata standard comes in two parts (ISO 19115 and ISO 19115-2) that have different root elements (gmd:MD_Metadata or gmi:MI_Metadata). THE MI_Metadata object is an extension of MD_Metadata which means that it includes many of the same elements. The xPaths to these elements are different in the two parts of the standard because the root elements are different. For example the metadata contact is at /gmd:MD_Metadata/gmd:contact in ISO 19115 and at /gmi:MI_Metadata/gmd:contact in ISO 19115-2. Both of these paths can be written as /*/gmd:contact which indicates a gmd:contact element just below the root element regardless of the name of the root element. Note that this xPath is different than //gmd:contact which specifies a gmd:contact at any level in the hierarchy.

Datasets and services: Datasets and services share many metadata properties as indicated by the fact that they are represented by the same abstract class (gmd:identificationInfo) in the ISO metadata schema. This abstract class can be represented by a wildcard in an xPath expression in order to access the same properties of datasets or services. For example, the path to a dataset title is: /*/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString and the path to a service title is /*/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString. Wildcards allow the specification of the path to a dataset or service title as /*/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString.