https://projects.ecoinformatics.org/ecoinfo/https://projects.ecoinformatics.org/ecoinfo/ecoinfo/favicon.ico?14691340362006-01-26T19:04:00ZEcoinformatics RedmineMorpho - Bug #2221: prompt user to convert eml200 packages to eml201https://projects.ecoinformatics.org/ecoinfo/issues/2221?journal_id=75782006-01-26T19:04:00ZP. Andersonanderson@nceas.ucsb.edu
<ul></ul><p>I ran into a bunch of trouble trying to surgically change the xmlns:eml<br />[namespace] node, then a discussion with MJ revealed that changing any part of<br />the data package requires a new version of the document to be created. This is<br />good news because it's probably much easier to create a new EML200DataPackage<br />from XML.</p> Morpho - Bug #2221: prompt user to convert eml200 packages to eml201https://projects.ecoinformatics.org/ecoinfo/issues/2221?journal_id=75792006-02-04T02:02:39ZP. Andersonanderson@nceas.ucsb.edu
<ul></ul><p>The saga continues. Reloading the document does not seem to make any<br />difference, or the XML parser will not load the XML.</p>
<ol>
<li>I have successfully altered the root node so that it appears like so...</li>
</ol>
<p><eml:eml packageId="jscientist.2.2" system="knb" <br />xmlns:ds="eml://ecoinformatics.org/dataset-2.0.0" <br />xmlns:eml="eml://ecoinformatics.org/eml-2.0.1" <br />xmlns:stmml="http://www.xml-cml.org/schema/stmml" <br />xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <br />xsi:schemaLocation="eml://ecoinformatics.org/eml-2.0.1 eml.xsd"></p>
<p>Please note the xmlns:ds attribute which has a "...dataset-2.0.0" value. I have<br />no idea what this is and wonder if it too should be changed to a 2.0.1 (e.g.<br />"...dataset-2.0.1").</p>
<p>Here is how I am reloading the altered data package (SaveDialog line 320):</p>
<pre><code>adp = (EML200DataPackage)DataPackageFactory.getDataPackage(<br /> new java.io.StringReader(<br /> XMLUtil.getDOMTreeAsString(<br /> adp.getMetadataNode().cloneNode().getOwnerDocument())),<br /> false, true);</code></pre>
<p>DataPackageFactory seems to comply. It says...<br /> DocTypeInfo: eml://ecoinformatics.org/eml-2.0.1<br /> Creating new eml-2.0.x package from metadata stream<br /> loading new eml-2.0.x DOM</p>
<p>But then we run into the same problem as before when attempting to query with<br />XPath...<br /> genericName: /xpathKeyMap/contextNode[@name='package']/accessionNumber<br /> Error in getGenericValue: javax.xml.transform.TransformerException: <br /> XMLUtilities.getNodeListWithXPath() received NULL rootNode</p>
<ol>
<li>So I tried an alternate method; reparsing the XML gave this error:</li>
</ol>
<p>"The markup in the document following the root element must be well-formed."</p>
<p>Strange, since our own EML validator liked it and said, "Document is XML-schema<br />valid. There were no XML errors found in your document." </p>
<pre><code><a class="external" href="http://machination.msi.ucsb.edu/~anderson/work/eml201.xml">http://machination.msi.ucsb.edu/~anderson/work/eml201.xml</a><br /> <a class="external" href="http://knb.ecoinformatics.org/emlparser">http://knb.ecoinformatics.org/emlparser</a></code></pre>
<pre><code>adp = (EML200DataPackage)DataPackageFactory.getDataPackage(<br /> new java.io.StringReader(<br /> XMLUtil.getDOMTreeAsString(<br /> adp.getMetadataNode().cloneNode(true).getOwnerDocument())),<br /> false, true);</code></pre>
<p>BAFFLED.</p> Morpho - Bug #2221: prompt user to convert eml200 packages to eml201https://projects.ecoinformatics.org/ecoinfo/issues/2221?journal_id=75802006-02-06T20:01:23ZP. Andersonanderson@nceas.ucsb.edu
<ul></ul><p>At long last, some progress has been made on this issue. I was very close<br />before: the XML input stream needed to be reset right before parsing.</p>
<p>But what about this attribute of <eml:eml>? Does it also need to be changed<br />along with xmlns:eml and xsi:schemaLocation?</p>
<pre><code>xmlns:ds="eml://ecoinformatics.org/dataset-2.0.0"</code></pre>
<p>I couldn't find any documentation about this attribute and don't want to mess<br />anything up. Please respond if you know and then I'll close up this bug.</p> Morpho - Bug #2221: prompt user to convert eml200 packages to eml201https://projects.ecoinformatics.org/ecoinfo/issues/2221?journal_id=75812006-02-10T23:30:17ZP. Andersonanderson@nceas.ucsb.edu
<ul></ul><p>After confering with MJ, the xmlns:ds attribute is a bit of a fluke related to<br />old jscientist documents and there is no issue. So without further ado I<br />pronounce this bug CLOSED.</p> Morpho - Bug #2221: prompt user to convert eml200 packages to eml201https://projects.ecoinformatics.org/ecoinfo/issues/2221?journal_id=75822013-03-27T21:19:31ZRedmine Admin
<ul></ul><p>Original Bugzilla ID was 2221</p>