This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
John, I was able to extract the source for them from the distributed jar.private void writeOneEntry(InvDataset ds, OutputStream out, StringBuffer mess) throws IOException
{
Element rootElem = writeOneEntry(ds, mess);
Document doc = new Document(rootElem);
XMLOutputter fmt = new XMLOutputter(Format.getPrettyFormat());
fmt.output(doc, out);
}
public Element writeOneEntry(InvDataset ds, StringBuffer mess)
throws IOException {
return writeOneEntry(ds, mess, false);
}
public Element writeOneRelaxedEntry(InvDataset ds, StringBuffer
mess) throws IOException {
return writeOneEntry(ds, mess, true);
}
public Element writeOneEntry(InvDataset ds, StringBuffer mess,
boolean relaxed) throws IOException {
Element rootElem = new Element("DIF", defNS);
writeDataset(ds, rootElem, mess);
rootElem.addNamespaceDeclaration(defNS);
rootElem.addNamespaceDeclaration(XMLEntityResolver.xsiNS);
rootElem.setAttribute("schemaLocation", defNS.getURI() + " " +
schemaLocation, XMLEntityResolver.xsiNS);
return rootElem;
}
Thanks for checking.
Cheers,
Roger
On Oct 20, 2009, at 12:33 PM, John Caron wrote:
David Stuebe wrote:i dont have any such routines - where did he get the code that calls those?Hi John CC RogerI am working with Roger Unwin on the OOI project and he has been trying to get a metadata extraction program working which builds against the NetCDF Java library. He has been stumped by two subroutines which he can not find:Element difWriter.writeOneEntryX(InvDataset, StringBuffer); Element difWriter.writeOneRelaxedEntry(InvDataset, StringBuffer);Can you point us in the right direction for the correct subroutine to use?