public String writeXML(Variable v) throws IOException { // Output the document, use standard formatter //fmt = new XMLOutputter(" ", true); //fmt.setLineSeparator("\n"); fmt = new XMLOutputter(Format.getPrettyFormat()); return fmt.outputString(makeDocument( null)); }
public String writeXML(Variable v) throws IOException { // Output the document, use standard formatter //fmt = new XMLOutputter(" ", true); //fmt.setLineSeparator("\n"); fmt = new XMLOutputter(Format.getPrettyFormat()); return fmt.outputString(makeDocument( null)); }
/** * Write a NetcdfFile as an XML document to the specified stream. * * @param ncfile NcML for this NetcdfFile * @param os write to this OutputStream * @param location normally null, meaning use ncd.getLocation(); otherwise put this into the NcML location * @throws IOException on io error */ public void writeXML(NetcdfFile ncfile, OutputStream os, String location) throws IOException { if (ncfile instanceof NetcdfDataset) ncd = (NetcdfDataset) ncfile; else ncd = new NetcdfDataset(ncfile, false); fmt = new XMLOutputter(Format.getPrettyFormat()); fmt.output(makeDocument(location), os); }
/** * Write a NetcdfFile as an XML document to the specified stream. * * @param ncfile NcML for this NetcdfFile * @param os write to this OutputStream * @param location normally null, meaning use ncd.getLocation(); otherwise put this into the NcML location * @throws IOException on io error */ public void writeXML(NetcdfFile ncfile, OutputStream os, String location) throws IOException { if (ncfile instanceof NetcdfDataset) ncd = (NetcdfDataset) ncfile; else ncd = new NetcdfDataset(ncfile, false); fmt = new XMLOutputter(Format.getPrettyFormat()); fmt.output(makeDocument(location), os); }
/** * Write NcML from specified NetcdfFile to a String. * * @param ncfile NcML for this NetcdfFile * @return the NcML in a String * @throws IOException on io error */ public String writeXML(NetcdfFile ncfile) throws IOException { if (ncfile instanceof NetcdfDataset) ncd = (NetcdfDataset) ncfile; else ncd = new NetcdfDataset(ncfile, false); // Output the document, use standard formatter //fmt = new XMLOutputter(" ", true); //fmt.setLineSeparator("\n"); fmt = new XMLOutputter(Format.getPrettyFormat()); return fmt.outputString(makeDocument( null)); }
/** * Write NcML from specified NetcdfFile to a String. * * @param ncfile NcML for this NetcdfFile * @return the NcML in a String * @throws IOException on io error */ public String writeXML(NetcdfFile ncfile) throws IOException { if (ncfile instanceof NetcdfDataset) ncd = (NetcdfDataset) ncfile; else ncd = new NetcdfDataset(ncfile, false); // Output the document, use standard formatter //fmt = new XMLOutputter(" ", true); //fmt.setLineSeparator("\n"); fmt = new XMLOutputter(Format.getPrettyFormat()); return fmt.outputString(makeDocument( null)); }
public void writeXMLexplicit(NetcdfFile ncfile, OutputStream os, String location) throws IOException { if (ncfile instanceof NetcdfDataset) ncd = (NetcdfDataset) ncfile; else ncd = new NetcdfDataset(ncfile, false); fmt = new XMLOutputter(Format.getPrettyFormat()); Document doc = makeDocument(location); Element root = doc.getRootElement(); root.addContent( new Element("explicit", ncNS)); fmt.output(doc, os); }
public void writeXMLexplicit(NetcdfFile ncfile, OutputStream os, String location) throws IOException { if (ncfile instanceof NetcdfDataset) ncd = (NetcdfDataset) ncfile; else ncd = new NetcdfDataset(ncfile, false); fmt = new XMLOutputter(Format.getPrettyFormat()); Document doc = makeDocument(location); Element root = doc.getRootElement(); root.addContent( new Element("explicit", ncNS)); fmt.output(doc, os); }