Hi,
I am trying to validate some metadata records on batch import, but I am
getting validation errors. The metadata file in question validates fine in
XML tools and custom schema validation, so I am wondering what the problem
is.
The error message I am getting is:
IllegalArgumentException : Cannot find a namespace to set for element
gmd:MD_Metadata with namespace URI http://www.isotc211.org/2005/gmd
The beginning of my MD file is:
<?xml version="1.0" encoding="UTF-8"?>
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.isotc211.org/2005/gmd
http://wis.wmo.int/2011/schemata/iso19139_2007/schema/gmd/gmd.xsd
http://www.isotc211.org/2005/gmx
http://wis.wmo.int/2011/schemata/iso19139_2007/schema/gmx/gmx.xsd">
I should say that I replaced the iso19139 schema in xml/schemas with a
different one copying the new one over the old one, so that GN custom
files are still there. As far as I can see with the eclipse debugger the
GMD namespace is loaded fine. (SchemaLoader.load returns:
{gco=[Namespace: prefix "gco" is mapped to URI
"http://www.isotc211.org/2005/gco"\], gmd=[Namespace: prefix "gmd" is
mapped to URI "http://www.isotc211.org/2005/gmd"\], xlink=[Namespace:
prefix "xlink" is mapped to URI "http://www.w3.org/1999/xlink"\],
srv=[Namespace: prefix "srv" is mapped to URI
"http://www.isotc211.org/2005/srv"\], gml=[Namespace: prefix "gml" is
mapped to URI "http://www.opengis.net/gml/3.2"\], gsr=[Namespace: prefix
"gsr" is mapped to URI "http://www.isotc211.org/2005/gsr"\],
gss=[Namespace: prefix "gss" is mapped to URI
"http://www.isotc211.org/2005/gss"\], gts=[Namespace: prefix "gts" is
mapped to URI "http://www.isotc211.org/2005/gts"\], gmi=[Namespace: prefix
"gmi" is mapped to URI "http://www.isotc211.org/2005/gmi"\],
gmx=[Namespace: prefix "gmx" is mapped to URI
"http://www.isotc211.org/2005/gmx"\]}
The reason for my replacing the schema is that we are using
xmlns:gml="http://www.opengis.net/gml/3.2" rather than
xmlns:gml="http://www.opengis.net/gml" in our medata files.
any hints?
Timo