Hi Martin,
I believe that the root element for metadata should be MD_Metadata and =
the
reference to the schema should be as follows:
<?xml version=3D"1.0" encoding=3D"UTF-8" ?>
<MD_Metadata xmlns=3D"http://www.isotc211.org/2005/gmd"
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=3D"http://www.isotc211.org/2005/gmd
http://www.isotc211.org/2005/gmd/metadataEntity.xsd">
<fileIdentifier>
...
</MD_metadata>
This should resolve your initial problem of not being able to find the =
root
element.
You should really download the ISO 19139 XML schema and store them on =
your
local system to speed up the validation and to reduce the bandwidth use. =
To
do this you will need to create an OASIS XML Catalog file and get your
validation script to call it to find the local copies of the XSDs. Note =
that
the reference in the schemaLocation *should not change*. It would be =
very
bad to have to change every single metadata record just to validate it =
using
local copies of the XSDs.
I don't know what GeoNetwork does but it should do something similar to
prevent bandwidth usage as well as solve problems caused by access =
through
firewalls.
Any validation should do full-schema checking to fully apply the W3C XML
Schema specification rather than some methods that second rate =
validation
software use. ;--)
I hope that this helps.
John
> -----Original Message-----
> From: geonetwork-devel-bounces@...
> [mailto:geonetwork-devel-bounces@...] On=20
> Behalf Of Martin Kofahl
> Sent: Thursday, 27 July 2006 7:42 PM
> To: Geonetwork-devel@...
> Subject: [Geonetwork-devel] iso19139 validation
>=20
>=20
> Hi!
> Currently, I try to add an iso19139 dataset via XML Insert Form. It=20
> doensn't work for me, and I don't know why. Sample file is attached.=20
> Further, I replaced all namespaces=20
> http://www.isotc211.org/schemas/2005/=20
> to http://www.isotc211.org/2005/ (not sure which one is correct).
>=20
> When inserting, error message is "cannot find root element".
>=20
> Error occures in org.fao.geonet.kernel.DataManager.extractUUID:
> String uuid =3D Xml.transform(md, styleSheet).getText().trim();
>=20
> In jeeves.utils.xml it's transform(Element xml, String=20
> styleSheetPath):
> return (Element)resXml.getDocument().getRootElement().detach();
>=20
>=20
> I _think_ resXml.getDocument() is null (however, resXml.getResult()=20
> looks ok), but I did play with the source quite a while, may be there=20
> are some other errors now. Could someone try to insert this dataset=20
> (attend to namespaces!).
>=20
> Thank you!
> Martin
>=20
|