The saga continues. Reloading the document does not seem to make any
difference, or the XML parser will not load the XML.
- 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
- 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.