Project

General

Profile

Actions

Bug #2221

closed

prompt user to convert eml200 packages to eml201

Added by Matt Jones over 18 years ago. Updated over 18 years ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
morpho - general
Target version:
Start date:
10/05/2005
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2221

Description

Currently users can edit both eml200 and eml201 documents in Morpho. In general
we would prefer them to use 201 format, so we should prompt them to convert
their document to eml201 when they try to save a eml200 document. If they say
yes, then the namespace will need to be changed. If they say no, then it is not
changed and the document is saved as an eml200 document.

Actions #1

Updated by P. Anderson over 18 years ago

I ran into a bunch of trouble trying to surgically change the xmlns:eml
[namespace] node, then a discussion with MJ revealed that changing any part of
the data package requires a new version of the document to be created. This is
good news because it's probably much easier to create a new EML200DataPackage
from XML.

Actions #2

Updated by P. Anderson over 18 years ago

The saga continues. Reloading the document does not seem to make any
difference, or the XML parser will not load the XML.

  1. I have successfully altered the root node so that it appears like so...

<eml:eml packageId="jscientist.2.2" system="knb"
xmlns:ds="eml://ecoinformatics.org/dataset-2.0.0"
xmlns:eml="eml://ecoinformatics.org/eml-2.0.1"
xmlns:stmml="http://www.xml-cml.org/schema/stmml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.0.1 eml.xsd">

Please note the xmlns:ds attribute which has a "...dataset-2.0.0" value. I have
no idea what this is and wonder if it too should be changed to a 2.0.1 (e.g.
"...dataset-2.0.1").

Here is how I am reloading the altered data package (SaveDialog line 320):

adp = (EML200DataPackage)DataPackageFactory.getDataPackage(
new java.io.StringReader(
XMLUtil.getDOMTreeAsString(
adp.getMetadataNode().cloneNode().getOwnerDocument())),
false, true);

DataPackageFactory seems to comply. It says...
DocTypeInfo: eml://ecoinformatics.org/eml-2.0.1
Creating new eml-2.0.x package from metadata stream
loading new eml-2.0.x DOM

But then we run into the same problem as before when attempting to query with
XPath...
genericName: /xpathKeyMap/contextNode[@name='package']/accessionNumber
Error in getGenericValue: javax.xml.transform.TransformerException:
XMLUtilities.getNodeListWithXPath() received NULL rootNode

  1. So I tried an alternate method; reparsing the XML gave this error:

"The markup in the document following the root element must be well-formed."

Strange, since our own EML validator liked it and said, "Document is XML-schema
valid. There were no XML errors found in your document."

http://machination.msi.ucsb.edu/~anderson/work/eml201.xml
http://knb.ecoinformatics.org/emlparser
adp = (EML200DataPackage)DataPackageFactory.getDataPackage(
new java.io.StringReader(
XMLUtil.getDOMTreeAsString(
adp.getMetadataNode().cloneNode(true).getOwnerDocument())),
false, true);

BAFFLED.

Actions #3

Updated by P. Anderson over 18 years ago

At long last, some progress has been made on this issue. I was very close
before: the XML input stream needed to be reset right before parsing.

But what about this attribute of <eml:eml>? Does it also need to be changed
along with xmlns:eml and xsi:schemaLocation?

xmlns:ds="eml://ecoinformatics.org/dataset-2.0.0"

I couldn't find any documentation about this attribute and don't want to mess
anything up. Please respond if you know and then I'll close up this bug.

Actions #4

Updated by P. Anderson over 18 years ago

After confering with MJ, the xmlns:ds attribute is a bit of a fluke related to
old jscientist documents and there is no issue. So without further ado I
pronounce this bug CLOSED.

Actions #5

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 2221

Actions

Also available in: Atom PDF