Skip to content

Commit d6dd515

Browse files
committed
Accept DMR version 2.0 in addition to 1.0
1 parent 46c1495 commit d6dd515

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

dap4/src/main/java/dap4/core/dmr/parser/DOM4Parser.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright 2012, UCAR/Unidata.
3-
* See the LICENSE file for more information.
2+
* Copyright (c) 2012-2026 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE for license information.
44
*/
55

66
package dap4.core.dmr.parser;
@@ -35,7 +35,8 @@ public class DOM4Parser implements Dap4Parser {
3535
// Constants
3636

3737
static final float DAPVERSION = 4.0f;
38-
static final float DMRVERSION = 1.0f;
38+
static final float DMRVERSION_10 = 1.0f;
39+
static final float DMRVERSION_20 = 2.0f;
3940

4041
static final String DEFAULTATTRTYPE = "Int32";
4142

@@ -461,9 +462,9 @@ protected void parsedataset(Node rootnode) throws ParseException {
461462
try {
462463
ndmrversion = Float.parseFloat(dmrversion);
463464
} catch (NumberFormatException nfe) {
464-
ndmrversion = DMRVERSION;
465+
ndmrversion = DMRVERSION_10;
465466
}
466-
if (ndmrversion != DMRVERSION)
467+
if (ndmrversion != DMRVERSION_10 && ndmrversion != DMRVERSION_20)
467468
throw new ParseException("Dataset dmrVersion mismatch: " + dmrversion);
468469
this.root = factory.newDataset(name);
469470
this.root.setDapVersion(Float.toString(ndapversion));

0 commit comments

Comments
 (0)