Project

General

Profile

« Previous | Next » 

Revision 2224

Added by sgarg over 20 years ago

Added code to read EML2.0.1 into source code.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
1450 1450
                } else if (needSchemaValidation(xml)) {
1451 1451
                    // for eml2
1452 1452
                    String namespace = findNamespace(xml);
1453
                    if (namespace.compareTo(DocumentImpl.EML2_0_0NAMESPACE)
1454
                                == 0) {
1453
                    if (namespace.compareTo(DocumentImpl.EML2_0_0NAMESPACE) == 0
1454
                                || namespace.compareTo(
1455
                                DocumentImpl.EML2_0_1NAMESPACE) == 0) {
1455 1456
                        // set eml2 base validation parser
1456 1457
                        String rule = DocumentImpl.EML200;
1457 1458
                        // using emlparser to check id validation
......
1631 1632
        String namespace = null;
1632 1633

  
1633 1634
        String eml2_0_0NameSpace = DocumentImpl.EML2_0_0NAMESPACE;
1635
        String eml2_0_1NameSpace = DocumentImpl.EML2_0_1NAMESPACE;
1634 1636
        String eml2_1_0NameSpace = DocumentImpl.EML2_1_0NAMESPACE;
1635 1637

  
1636 1638
        if (xml == null) {
......
1666 1668
                    + schemaLocation, 30);
1667 1669
            if (schemaLocation.indexOf(eml2_0_0NameSpace) != -1) {
1668 1670
                namespace = eml2_0_0NameSpace;
1671
            } else if (schemaLocation.indexOf(eml2_0_1NameSpace) != -1) {
1672
                namespace = eml2_0_1NameSpace;
1669 1673
            } else if (schemaLocation.indexOf(eml2_1_0NameSpace) != -1) {
1670 1674
                namespace = eml2_1_0NameSpace;
1671 1675
            }
......
1673 1677

  
1674 1678
        MetaCatUtil.debugMessage("Validation for eml is " + namespace,
1675 1679
                10);
1680
    MetaCatUtil.debugMessage("Validation for eml is " + eml2_0_1NameSpace,
1681
          10);
1682

  
1676 1683
        return namespace;
1677 1684

  
1678 1685
    }
src/edu/ucsb/nceas/metacat/DocumentImpl.java
89 89
                              "http://xml.org/sax/features/namespace-prefixes";
90 90
   public static final String EML2_1_0NAMESPACE =
91 91
                                         MetaCatUtil.getOption("eml2_1_0namespace");
92
                                         // "eml://ecoinformatics.org/eml-2.0.0";
92
                                         // "eml://ecoinformatics.org/eml-2.1.0";
93
   public static final String EML2_0_1NAMESPACE =
94
                                         MetaCatUtil.getOption("eml2_0_1namespace");
95
                                         // "eml://ecoinformatics.org/eml-2.0.1";
93 96
   public static final String EML2_0_0NAMESPACE =
94 97
                                         MetaCatUtil.getOption("eml2_0_0namespace");
95 98
                                         // "eml://ecoinformatics.org/eml-2.0.0";

Also available in: Unified diff