You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tw...@locus.apache.org on 2000/01/12 21:57:27 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/validators/schema XSchemaValidator.java

twl         00/01/12 12:57:27

  Modified:    java/src/org/apache/xerces/validators/schema
                        XSchemaValidator.java
  Log:
  Bugfixes from gtj@peakin.com:
  1. Comment out calls to System.exit(1)
  2. Fix reportSchemaError to keep it from swallowing exceptions
  3. Correct bugs with integer subtype registration
  
  Revision  Changes    Path
  1.4       +11 -11    xml-xerces/java/src/org/apache/xerces/validators/schema/XSchemaValidator.java
  
  Index: XSchemaValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/schema/XSchemaValidator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSchemaValidator.java	1999/12/21 23:56:54	1.3
  +++ XSchemaValidator.java	2000/01/12 20:57:27	1.4
  @@ -1683,12 +1683,12 @@
           catch (SAXException se) {
               se.getException().printStackTrace();
               System.err.println("error parsing schema file");
  -            System.exit(1);
  +//            System.exit(1);
           }
           catch (Exception e) {
               e.printStackTrace();
               System.err.println("error parsing schema file");
  -            System.exit(1);
  +//            System.exit(1);
           }
           fSchemaDocument = fSchemaParser.getDocument();
           if (fSchemaDocument == null) {
  @@ -1703,7 +1703,7 @@
           }
           catch (Exception e) {
               e.printStackTrace(System.err);
  -            System.exit(1);
  +//            System.exit(1);
           }
       }
   
  @@ -2206,7 +2206,7 @@
           return index;
   	}
   
  -	public int traverseDatatypeDecl(Element datatypeDecl) {
  +	public int traverseDatatypeDecl(Element datatypeDecl) throws Exception {
   		int newTypeName = fStringPool.addSymbol(datatypeDecl.getAttribute(ATT_NAME));
   		int export = fStringPool.addSymbol(datatypeDecl.getAttribute(ATT_EXPORT));
   
  @@ -2449,7 +2449,7 @@
   		// attribute default type
   		int attDefaultType = -1;
   		int attDefaultValue = -1;
  -		boolean required = attrDecl.getAttribute("required").equals("true");
  +		boolean required = attrDecl.getAttribute("minoccurs").equals("1");
   		if (required) {
   			attDefaultType = fStringPool.addSymbol("#REQUIRED");
   		} else {
  @@ -3012,16 +3012,16 @@
       }
   
   	private void reportSchemaError(int major, Object args[]) {
  -	    try {
  +//	    try {
       		fErrorReporter.reportError(fErrorReporter.getLocator(),
   	    							   SchemaMessageProvider.SCHEMA_DOMAIN,
   		    						   major,
   			    					   SchemaMessageProvider.MSG_NONE,
   				    				   args,
   					    			   XMLErrorReporter.ERRORTYPE_RECOVERABLE_ERROR);
  -		} catch (Exception e) {
  -		    e.printStackTrace();
  -		}
  +//		} catch (Exception e) {
  +//		    e.printStackTrace();
  +//		}
   	}
   
       //
  @@ -3113,7 +3113,7 @@
   
           String integerSubtypeTable[][] = {
               { "non-negative-integer", DatatypeValidator.MININCLUSIVE , "0"},
  -            { "postive-integer", DatatypeValidator.MININCLUSIVE, "1"},
  +            { "positive-integer", DatatypeValidator.MININCLUSIVE, "1"},
               { "non-positive-integer", DatatypeValidator.MAXINCLUSIVE, "0"},
               { "negative-integer", DatatypeValidator.MAXINCLUSIVE, "-1"}
           };
  @@ -3149,7 +3149,7 @@
                   } catch (UnknownFacetException ufe) {
                       System.out.println("Internal error initializing registry - Unknown facet: "+integerSubtypeTable[i][0]);
                   }
  -                fRegistry.put(integerSubtypeTable[0], v);
  +                fRegistry.put(integerSubtypeTable[i][0], v);
               }
           }