Project

General

Profile

« Previous | Next » 

Revision 1610

Added by Jing Tao over 21 years ago

Revise code to decide use which parser.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
125 125
  private static final String ERRORCLOSE = "</error>";
126 126
  public static final String SCHEMALOCATIONKEYWORD = ":schemaLocation";
127 127
  public static final String NONAMESPACELOCATION = ":noNamespaceSchemaLocation";
128
  public static final String EML2KEYWORD ="<eml:eml";
128
  public static final String EML2KEYWORD =":eml";
129 129

  
130 130
  /**
131 131
   * Initialize the servlet by creating appropriate database connections
......
1742 1742
  private boolean needEml2Validation(String xml)
1743 1743
  {
1744 1744
    boolean needEml2Validate =false;
1745
    String emlNameSpace = "=\""+DocumentImpl.EMLNAMESPACE+"\"";
1745 1746
    if (xml == null)
1746 1747
    {
1747 1748
      MetaCatUtil.debugMessage("Validation for schema is " +
1748 1749
                               needEml2Validate, 10);
1749 1750
      return needEml2Validate;
1750 1751
    }
1751
    else if (xml.indexOf(EML2KEYWORD) != -1)
1752
    else if (xml.indexOf(EML2KEYWORD) != -1 && xml.indexOf(emlNameSpace) != -1)
1752 1753
    {
1753 1754
      // if contains schema location key word, should be validate
1754 1755
      needEml2Validate = true;

Also available in: Unified diff