String filename = "file:./" + TestNcML.topDir + "TestValuesFromAttribute.xml";
NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(ncml), filename, null);
System.out.println(" TestNcmlAggExisting.open " + filename + "\n" + ncfile);
Variable newVar = ncfile.findVariable("titleAsVariable");
assert null != newVar;
assert newVar.getShortName().equals("titleAsVariable");
assert newVar.getRank() == 0;
assert newVar.getSize() == 1;
assert newVar.getDataType() == DataType.STRING;
Array data = newVar.read();
assert data.getElementType() == String.class;
Object val = data.getObject(0);
assert val instanceof String;
assert val.equals("COADS 1-degree Equatorial Enhanced");
////////////////
newVar = ncfile.findVariable("titleAsVariable2");
assert null != newVar;
assert newVar.getShortName().equals("titleAsVariable2");
assert newVar.getRank() == 0;
assert newVar.getSize() == 1;
assert newVar.getDataType() == DataType.STRING;
data = newVar.read();
assert data.getElementType() == String.class;
val = data.getObject(0);
assert val instanceof String;
assert val.equals("COADS 1-degree Equatorial Enhanced");
///////////////
newVar = ncfile.findVariable("VariableAttribute");
assert null != newVar;
assert newVar.getShortName().equals("VariableAttribute");
assert newVar.getRank() == 1;
assert newVar.getSize() == 2;
assert newVar.getDataType() == DataType.DOUBLE;
data = newVar.read();
assert data.getRank() == 1;
assert data.getSize() == 2;
assert data.getElementType() == double.class;
double[] result = new double[] { 715511.0, 729360.0};