validating eml
Peter McCartney
peter.mccartney at asu.edu
Wed Oct 9 13:26:50 PDT 2002
becuase the various eml schema files do not set the elementFormDefault
attribute to "qualified" we are able to avoid having to set prefixs for all
our elements. however, this option forces us to define and use a prefix for
the root element of the instance document. thus a valid eml file will always
have to have eml:eml as the root element. Thats not something that is
intuitivly obvious to many users, and could even be confusint if they were
to convert the eml schmas to dtd's and then try to build instance documents.
The samples clearly show the proper format, but the documentation might make
this more apparent?
FYI, this is also true if you wish to build an instance file for a module
within eml. for example, the following file validates against
eml-dataset.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<ds:dataset xmlns:ds="eml://ecoinformatics.org/dataset-2.0.0rc2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/dataset-2.0.0rc2
C:\phm\cvsfiles\ecoinformatics\eml\eml-dataset.xsd">
<title>test dataset</title>
<creator>
<individualName>
<surName>mccartney</surName>
</individualName>
</creator>
<contact>
<individualName>
<surName>McCartney</surName>
</individualName>
</contact>
</ds:dataset>
this most likely does not fit some people's idea of a "valid" eml document
and the fact that it works may be fortuitous, but it does open some handy
doors for creative xml data management using eml fragments. You would have
to remember to strip the name space off the root when you go to add this
fragment to a document that would validate against eml.xsd.
Peter McCartney (peter.mccartney at asu.edu)
Center for Environmental Studies
Arizona State University
480-965-6791
> -----Original Message-----
> From: chad berkley [mailto:berkley at nceas.ucsb.edu]
> Sent: Wednesday, October 09, 2002 10:12 AM
> To: Tim Bergsma
> Cc: Eml-Dev (E-mail)
> Subject: Re: validating eml
>
>
> 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
>
> _______________________________________________
> eml-dev mailing list
> eml-dev at ecoinformatics.org
> http://www.ecoinformatics.org/mailman/listinfo/eml-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/eml-dev/attachments/20021009/9e775961/attachment.htm
More information about the Eml-dev
mailing list