ui/src/main/java/ucar/nc2/ui/op/NcmlEditor.java
private void checkNcml(Formatter f) {
        if (ncmlLocation == null) { return; }

        try {
            NetcdfDataset ncd = NetcdfDataset.openDataset(ncmlLocation);
            ncd.check(f);
        }
        catch (IOException ioe) {
            JOptionPane.showMessageDialog(this, "ERROR: " + ioe.getMessage());
            ioe.printStackTrace();
        }
    }
private void checkNcml(Formatter f) {
        if (ncmlLocation == null) { return; }

        try {
            NetcdfDataset ncd = NetcdfDataset.openDataset(ncmlLocation);
            ncd.check(f);
        }
        catch (IOException ioe) {
            JOptionPane.showMessageDialog(this, "ERROR: " + ioe.getMessage());
            ioe.printStackTrace();
        }
    }
Read text from textArea through NcMLReader
then write it back out via resulting dataset