You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2002/01/14 21:55:01 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/traversers XSDAbstractTraverser.java XSDNotationTraverser.java XSDSimpleTypeTraverser.java

elena       02/01/14 12:55:01

  Modified:    java/src/org/apache/xerces/impl/msg
                        XMLSchemaMessages.properties
               java/src/org/apache/xerces/impl/xs/traversers
                        XSDAbstractTraverser.java XSDNotationTraverser.java
                        XSDSimpleTypeTraverser.java
  Log:
  update error messages
  
  Revision  Changes    Path
  1.36      +7 -6      xml-xerces/java/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
  
  Index: XMLSchemaMessages.properties
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- XMLSchemaMessages.properties	10 Jan 2002 18:58:21 -0000	1.35
  +++ XMLSchemaMessages.properties	14 Jan 2002 20:55:01 -0000	1.36
  @@ -77,6 +77,7 @@
   
   #validation (3.X.4)
   
  +        declaration-not-found = component {0} with name {1} was not found.
           cvc-assess-attr = cvc-assess-attr: error.
           cvc-assess-elt = cvc-assess-elt: error.
           cvc-attribute.1 = cvc-attribute.1: error.
  @@ -97,6 +98,7 @@
           cvc-complex-type.4 = cvc-complex-type.4: Attribute ''{1}'' must appear on element ''{0}''.
           cvc-complex-type.5.1 = cvc-complex-type.5.1: In element ''{0}'', attribute ''{1}'' is a Wild ID. But there is already a Wild ID ''{2}''.
           cvc-complex-type.5.2 = cvc-complex-type.5.2: In element ''{0}'', attribute ''{1}'' is a Wild ID. But there is already a attribute ''{2}'' from the attribute uses.
  +        cvc-complex-type.5.3 = cvc-complex-type.5.2: Attribute ''{0}'' is a Wild ID. But there is already a attribute ''{1}'' from the attribute uses.
           cvc-datatype-valid.1.1 = cvc-datatype-valid.1.1: error.
           cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: error.
           cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: error.
  @@ -133,7 +135,7 @@
           cvc-particle = cvc-particle: error.
           cvc-pattern-valid = cvc-pattern-valid: error.
           cvc-resolve-instance = cvc-resolve-instance: error.
  -        cvc-simple-type = cvc-simple-type: error.
  +        cvc-simple-type = cvc-simple-type: {0}.
           cvc-totalDigits-valid = cvc-totalDigits-valid: error.
           cvc-type.1 = cvc-type.1: error.
           cvc-type.2 = cvc-type.2: The type definition must not be abstract.
  @@ -158,7 +160,7 @@
   
           sch-props-correct = Duplicate declaration for an element ''{0}''
           schema_reference = schema_reference: error.
  -        src-annotation = src-annotation: error.
  +        src-annotation = src-annotation: can only contain <appinfo> and <documentation> elements.
           src-attribute.1 = src-attribute.1: ''default'' and ''fixed'' must not both be present in attribute declaration ''{0}''.
           src-attribute.2 = src-attribute.2: : ''default'' is present in attribute ''{0}'', so ''use'' must be ''optional''.
           src-attribute.3.1 = src-attribute.3.1: One of ''ref'' or ''name'' must be present in a local attribute declaration..
  @@ -185,7 +187,7 @@
           src-model_group_defn = src-model_group_defn: error.
           src-multiple-enumerations = src-multiple-enumerations: error.
           src-multiple-patterns = src-multiple-patterns: error.
  -        src-notation = src-notation: error.
  +        src-notation = src-notation: {0}.        
           src-qname = src-qname: error.
           src-redefine.1 = src-redefine.1: the component ''{0}'' occurs in a schema different from that which was redefined.
           src-redefine.5 = src-redefine.5: <simpleType> or <complexType> children of <redefine> elements must have <extension> or <restriction> descendants referring to themselves.
  @@ -201,9 +203,9 @@
           src-resolve.4 = src-resolve.4: Components from namespace ''{1}'' are not referenceable from schema document ''{0}''.
           src-restriction-base-or-simpleType = src-restriction-base-or-simpleType: error.
           src-simple-type = src-simple-type: error.
  -        src-single-facet-value = src-single-facet-value: error.
  +        src-single-facet-value = src-single-facet-value: {0}
           src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: error.
  -        src-wildcard = src-wildcard: error.
  +        src-wildcard = src-wildcard: error {0}.
           st-restrict-facets = st-restrict-facets: error.
   
   #constraint valid (3.X.6)
  @@ -347,6 +349,5 @@
   
   
   # Datatypes
  -  NotationContentRestricted = content for notation ''{0}'' must be: (annotation?)
     DatatypeFacetError = Invalid facet: ''{0}''
     WhitespaceFacetError = whiteSpace value ''{0}'' for this type must be collapse.
  
  
  
  1.6       +16 -24    xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
  
  Index: XSDAbstractTraverser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XSDAbstractTraverser.java	10 Jan 2002 17:11:28 -0000	1.5
  +++ XSDAbstractTraverser.java	14 Jan 2002 20:55:01 -0000	1.6
  @@ -93,7 +93,7 @@
    * @author Rahul Srivastava, Sun Microsystems Inc.
    * @author Neeraj Bajaj, Sun Microsystems Inc.
    *
  - * @version $Id: XSDAbstractTraverser.java,v 1.5 2002/01/10 17:11:28 sandygao Exp $
  + * @version $Id: XSDAbstractTraverser.java,v 1.6 2002/01/14 20:55:01 elena Exp $
    */
   abstract class XSDAbstractTraverser {
   
  @@ -155,7 +155,7 @@
               // "appinfo" and "documentation"
               if (!((name.equals(SchemaSymbols.ELT_APPINFO)) ||
                     (name.equals(SchemaSymbols.ELT_DOCUMENTATION)))) {
  -                reportGenericSchemaError("an <annotation> can only contain <appinfo> and <documentation> elements");
  +                reportSchemaError("src-annotation", null);
               }
   
               // General Attribute Checking
  @@ -218,11 +218,10 @@
                       try{
                           QName temp = (QName)fQNameDV.validate(enumVal, schemaDoc.fValidationContext, null);
                           if (fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.NOTATION_TYPE, temp) == null) {
  -                            reportGenericSchemaError("Notation '" + temp.localpart +
  -                                                     "' not found in the grammar "+ temp.uri);
  +                            reportSchemaError("declaration-not-found", new Object [] {"notation", temp.localpart});
                           }
                       }catch(InvalidDatatypeValueException ex){
  -                        reportGenericSchemaError(ex.getMessage());
  +                        reportSchemaError("cvc-simple-type", new Object[]{ ex.getMessage()});
                       }
                       // restore to the normal namespace context
                       schemaDoc.fValidationContext.setNamespaceSupport(schemaDoc.fNamespaceSupport);
  @@ -240,7 +239,8 @@
                            child = DOMUtil.getNextSiblingElement(child);
                        }
                        if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
  -                          reportGenericSchemaError("Enumeration facet has more than one annotation.");
  +                         Object[] args = new Object [] {"Enumeration facet has more than one annotation."};
  +                         reportSchemaError("cvc-simple-type", args);
                        }
                  }
               }
  @@ -263,7 +263,8 @@
                                child = DOMUtil.getNextSiblingElement(child);
                            }
                            if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
  -                              reportGenericSchemaError("Pattern facet has more than one annotation.");
  +                              Object[] args = new Object [] {"Pattern facet has more than one annotation."};
  +                              reportSchemaError("cvc-simple-type", args);
                            }
                      }
                   }
  @@ -307,10 +308,7 @@
   
                   // check for duplicate facets
                   if ((facetsPresent & currentFacet) != 0) {
  -                    fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
  -                                               "DatatypeError",
  -                                               new Object[]{"The facet '" + facet + "' is defined more than once."},
  -                                               XMLErrorReporter.SEVERITY_ERROR);
  +                    reportSchemaError("src-single-facet-value", new Object[]{"The facet '" + facet + "' is defined more than once."});
                   } else if (attrs[XSAttributeChecker.ATTIDX_VALUE] != null) {
                       facetsPresent |= currentFacet;
                       // check for fixed facet
  @@ -359,7 +357,7 @@
                           child = DOMUtil.getNextSiblingElement(child);
                       }
                       if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
  -                         reportGenericSchemaError(facet+" facet has more than one annotation.");
  +                        reportSchemaError("cvc-simple-type", new Object[]{facet+" facet has more than one annotation."});                        
                       }
                   }
               }
  @@ -430,15 +428,12 @@
                                               tempAttrUse.fAttrDecl.fName)==null) {
                       String idName = attrGrp.addAttributeUse(tempAttrUse);
                       if (idName != null) {
  -                        reportGenericSchemaError("Two distinct members of the {attribute uses} '" +
  -                                                 idName + "' and '" + tempAttrUse.fAttrDecl.fName +
  -                                                 "' have {attribute declaration}s both of whose {type definition}s are or are derived from ID");
  +                        reportSchemaError("cvc-complex-type.5.3",new Object[]{tempAttrUse.fAttrDecl.fName, idName});
                       }
                   }
                   else {
                       // REVISIT: what if one of the attribute uses is "prohibited"
  -                    reportGenericSchemaError("Duplicate attribute " +
  -                                             tempAttrUse.fAttrDecl.fName + " found ");
  +                    reportSchemaError("ct-props-correct.4", new Object[]{"Duplicate attribute " + tempAttrUse.fAttrDecl.fName + " found "});
                   }
               }
               else if (childName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
  @@ -454,15 +449,12 @@
                       if (existingAttrUse == null) {
                           String idName = attrGrp.addAttributeUse(attrUseS[i]);
                           if (idName != null) {
  -                            reportGenericSchemaError("Two distinct members of the {attribute uses} '" +
  -                                                     idName + "' and '" + attrUseS[i].fAttrDecl.fName +
  -                                                     "' have {attribute declaration}s both of whose {type definition}s are or are derived from ID");
  +                            reportSchemaError("cvc-complex-type.5.3", new Object[]{attrUseS[i].fAttrDecl.fName, idName});
                           }
                       }
                       else {
                           // REVISIT: what if one of the attribute uses is "prohibited"
  -                        reportGenericSchemaError("Duplicate attribute " +
  -                                                 existingAttrUse.fAttrDecl.fName + " found ");
  +                        reportSchemaError("ct-props-correct.4", new Object[]{"Duplicate attribute " + existingAttrUse.fAttrDecl.fName + " found "});
                       }
                   }
   
  @@ -475,7 +467,7 @@
                           attrGrp.fAttributeWC = attrGrp.fAttributeWC.
                                                  performIntersectionWith(tempAttrGrp.fAttributeWC, attrGrp.fAttributeWC.fProcessContents);
                           if (attrGrp.fAttributeWC == null) {
  -                            reportGenericSchemaError("intersection of wildcards is not expressible");
  +                            reportSchemaError("src-wildcard", new Object[]{"intersection of wildcards is not expressible"});                            
                           }
                       }
                   }
  @@ -497,7 +489,7 @@
                       attrGrp.fAttributeWC = tempAttrWC.
                                              performIntersectionWith(attrGrp.fAttributeWC, tempAttrWC.fProcessContents);
                       if (attrGrp.fAttributeWC == null) {
  -                        reportGenericSchemaError("intersection of wildcards is not expressible");
  +                        reportSchemaError("src-wildcard", new Object[]{"intersection of wildcards is not expressible"});                            
                       }
                   }
                   child = DOMUtil.getNextSiblingElement(child);
  
  
  
  1.2       +4 -7      xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDNotationTraverser.java
  
  Index: XSDNotationTraverser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDNotationTraverser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSDNotationTraverser.java	25 Oct 2001 20:36:04 -0000	1.1
  +++ XSDNotationTraverser.java	14 Jan 2002 20:55:01 -0000	1.2
  @@ -79,7 +79,7 @@
    *
    * @author Rahul Srivastava, Sun Microsystems Inc.
    * @author Elena Litani, IBM
  - * @version $Id: XSDNotationTraverser.java,v 1.1 2001/10/25 20:36:04 elena Exp $
  + * @version $Id: XSDNotationTraverser.java,v 1.2 2002/01/14 20:55:01 elena Exp $
    */
   class  XSDNotationTraverser extends XSDAbstractTraverser {
   
  @@ -100,13 +100,13 @@
           String  publicAttr = (String) attrValues[XSAttributeChecker.ATTIDX_PUBLIC];
           String  systemAttr = (String) attrValues[XSAttributeChecker.ATTIDX_SYSTEM];
           if (nameAttr == null) {
  -            reportGenericSchemaError("<notation> must have a name");
  +            reportSchemaError("src-notation", new Object[]{"<notation> must have a name"});
               fAttrChecker.returnAttrArray(attrValues, schemaDoc);
               return null;
           }
   
           if (publicAttr == null) {
  -            reportGenericSchemaError("<notation> must have 'public' attribute");
  +            reportSchemaError("src-notation", new Object[]{"<notation> must have 'public' attribute"});
           }
   
           XSNotationDecl notation = new XSNotationDecl();
  @@ -127,10 +127,7 @@
           }
           if (content!=null){
                Object[] args = new Object [] { DOMUtil.getLocalName(content) };
  -             fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
  -                                           "NotationContentRestricted",
  -                                           args,
  -                                           XMLErrorReporter.SEVERITY_ERROR);
  +             reportSchemaError("src-notation", args);
   
           }
           grammar.addGlobalNotationDecl(notation);
  
  
  
  1.7       +2 -2      xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java
  
  Index: XSDSimpleTypeTraverser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XSDSimpleTypeTraverser.java	3 Jan 2002 20:59:43 -0000	1.6
  +++ XSDSimpleTypeTraverser.java	14 Jan 2002 20:55:01 -0000	1.7
  @@ -116,7 +116,7 @@
    *
    * @author Elena Litani, IBM
    * @author Neeraj Bajaj, Sun Microsystems, Inc.
  - * @version $Id: XSDSimpleTypeTraverser.java,v 1.6 2002/01/03 20:59:43 sandygao Exp $
  + * @version $Id: XSDSimpleTypeTraverser.java,v 1.7 2002/01/14 20:55:01 elena Exp $
    */
   class XSDSimpleTypeTraverser extends XSDAbstractTraverser {
   
  @@ -479,7 +479,7 @@
                   fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
                   newDecl.applyFacets(facetData , presentFacets , fixedFacets, fValidationState);
               } catch (InvalidDatatypeFacetException ex) {
  -                reportGenericSchemaError("facet error when creating type '" + qualifiedName + "': " + ex.getLocalizedMessage());
  +                reportSchemaError("cvc-simple-type", new Object[]{"facet error when creating type '" + qualifiedName + "': " + ex.getLocalizedMessage()} );
               }
           }
           else { //union
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org