validating eml
chad berkley
berkley at nceas.ucsb.edu
Wed Oct 9 10:11:31 PDT 2002
well, you're partially right. The eml parser doesn't care what kind of
document it is. It just looks for ids and references as defined in the
lib/config.xml file.
The xml parser needs a namespace declaration to know what schema to
parse it against. you didn't include any namespace declarations so it
just told you it doesn't know what to do with it. Look at the example
documents in the spec for the correct namespace declaration. The root
element should look something like
<eml:eml
packageId="eml.1.1" system="knb"
xmlns:eml="eml://ecoinformatics.org/eml-2.0.0rc2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ds="eml://ecoinformatics.org/dataset-2.0.0rc2"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.0.0rc2 eml.xsd">
if you want it to validate against a different schema file, change the
xsi:schemaLocation attribute to point to another accessible schema. if
you just put the name of the schema file, it will try to use it's
internal catalog of schemas which only includes the newest rc2 schemas.
chad
On Wed, 2002-10-09 at 09:54, Tim Bergsma wrote:
> Chad,
>
> I created a trivial eml document as follows:
>
> <?xml version="1.0"?>
> <eml>
> <dataset>
> <title>Very important data from major research site.</title>
> <creator>
> <positionName>Site Data Manager</positionName>
> </creator>
> <contact>
> <positionName>Site Data Manager</positionName>
> </contact>
> </dataset>
> </eml>
>
> and got the following error:
> <report>
> Document is EML valid.
> There were no EML errors found in your document.
>
>
> --------------------------------------------------------------------------------
>
> XML-Schema Errors Found
> The following errors were found:
>
> cvc-elt.1: Cannot find the declaration of element 'eml'.
> </report>
>
> The EML pass apparently doesn't care what the root element is called,
> and the XML-Schema pass can't find the declaration of the root element,
> so I'm not convinced that I've validated anything.
>
> Tim.
>
> --
> Tim Bergsma
> LTER Information Manager
> W.K. Kellogg Biological Station
> Michigan State University
> Hickory Corners, MI 49060
> 616/671-2337
> tbergsma at kbs.msu.edu
> http://lter.kbs.msu.edu
More information about the Eml-dev
mailing list