You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by je...@locus.apache.org on 2000/11/28 01:16:09 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/validation/datatypes IDREFDatatypeValidator.java

jeffreyr    00/11/27 16:16:06

  Modified:    java/src/org/apache/xerces/impl Tag: xerces_j_2
                        XMLValidator.java
               java/src/org/apache/xerces/impl/msg Tag: xerces_j_2
                        XMLMessages.properties
               java/src/org/apache/xerces/impl/validation/datatypes Tag:
                        xerces_j_2 IDREFDatatypeValidator.java
  Log:
  fixed to pass IDREF id06.xml conformance testcase
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.43  +8 -10     xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java
  
  Index: XMLValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java,v
  retrieving revision 1.1.2.42
  retrieving revision 1.1.2.43
  diff -u -r1.1.2.42 -r1.1.2.43
  --- XMLValidator.java	2000/11/27 22:47:41	1.1.2.42
  +++ XMLValidator.java	2000/11/28 00:15:45	1.1.2.43
  @@ -104,7 +104,7 @@
    * @author Andy Clark, IBM
    * @author Jeffrey Rodriguez IBM
    *
  - * @version $Id: XMLValidator.java,v 1.1.2.42 2000/11/27 22:47:41 jeffreyr Exp $
  + * @version $Id: XMLValidator.java,v 1.1.2.43 2000/11/28 00:15:45 jeffreyr Exp $
    */
   public class XMLValidator
   implements XMLComponent, 
  @@ -1945,15 +1945,13 @@
                           fValIDRef.validate(value, null );
                       }
                   } catch (InvalidDatatypeValueException ex) {
  -                    if (ex.getMajorCode() != 1 && ex.getMinorCode() != -1) {
  -                        /*
  -                        reportRecoverableXMLError(ex.getMajorCode(),
  -                                                  ex.getMinorCode(),
  -                                                  fStringPool.toString( attributeDecl.name.rawname), value );
  -                                                  */
  -                    } else {
  -                        System.err.println("Error: " + ex.getLocalizedMessage() );//Should not happen
  -                    }
  +                    String  key = ex.getKeyIntoReporter();
  +
  +                    fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
  +                                                key,
  +                                                new Object[]{ ex.getMessage()},
  +                                                XMLErrorReporter.SEVERITY_ERROR );
  +
                   }
                   /*
                   if (fNormalizeAttributeValues) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.14  +1 -1      xml-xerces/java/src/org/apache/xerces/impl/msg/Attic/XMLMessages.properties
  
  Index: XMLMessages.properties
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/msg/Attic/XMLMessages.properties,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- XMLMessages.properties	2000/11/24 17:39:20	1.1.2.13
  +++ XMLMessages.properties	2000/11/28 00:15:54	1.1.2.14
  @@ -201,7 +201,7 @@
           IDDefaultTypeInvalid = The ID attribute \"{0}\" must have a declared default of \"#IMPLIED\" or \"#REQUIRED\".
           IDInvalid = Attribute value \"{0}\" of type ID must be a name.
           IDNotUnique = Attribute value \"{0}\" of type ID must be unique within the document.
  -        IDREFInvalid = Attribute value \"{1}\" of type IDREF must be a name.
  +        IDREFInvalid = Attribute value \"{0}\" of type IDREF must be a name.
           IDREFSInvalid = Attribute value \"{0}\" of type IDREFS must be one or more names.
           ImproperDeclarationNesting = The replacement text of parameter entity \"{0}\" must include properly nested declarations.
           ImproperGroupNesting = The replacement text of parameter entity \"{0}\" must include properly nested pairs of parentheses.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +3 -2      xml-xerces/java/src/org/apache/xerces/impl/validation/datatypes/Attic/IDREFDatatypeValidator.java
  
  Index: IDREFDatatypeValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/validation/datatypes/Attic/IDREFDatatypeValidator.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- IDREFDatatypeValidator.java	2000/11/23 00:11:05	1.1.2.7
  +++ IDREFDatatypeValidator.java	2000/11/28 00:16:01	1.1.2.8
  @@ -104,7 +104,7 @@
    * </CODE>
    * 
    * @author Jeffrey Rodriguez-
  - * @version $Id: IDREFDatatypeValidator.java,v 1.1.2.7 2000/11/23 00:11:05 jeffreyr Exp $
  + * @version $Id: IDREFDatatypeValidator.java,v 1.1.2.8 2000/11/28 00:16:01 jeffreyr Exp $
    * @see org.apache.xerces.impl.validation.datatypes.IDDatatypeValidator
    * @see org.apache.xerces.impl.validation.datatypes.AbstractDatatypeValidator
    * @see org.apache.xerces.impl.validation.DatatypeValidator
  @@ -150,7 +150,8 @@
      public void validate(String content, Object state ) throws InvalidDatatypeValueException{
         //Pass content as a String
         if (!XMLChar.isValidName(content)) {//Check if is valid key
  -         InvalidDatatypeValueException error = new InvalidDatatypeValueException( "IDREF is not valid" );//Need Message
  +         InvalidDatatypeValueException error = new InvalidDatatypeValueException( content );//Need Message
  +         error.setKeyIntoReporter( "IDREFInvalid" );
            throw error;//Need Message
         }
         addIdRef( content, state);// We are storing IDs