sandygao    2002/08/26 22:34:09

  Modified:    java/src/org/apache/xerces/impl/xs/models XSAllCM.java
                        XSEmptyCM.java
  Log:
  Fixing bug [12062]. After the first time we see an error in the "all" content
  model, we should change the state from "first error" to "subsequence error",
  so that the schema validator won't report one error multiple times.
  
  Revision  Changes    Path
  1.5       +13 -1     
xml-xerces/java/src/org/apache/xerces/impl/xs/models/XSAllCM.java
  
  Index: XSAllCM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/models/XSAllCM.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XSAllCM.java      15 Mar 2002 23:01:57 -0000      1.4
  +++ XSAllCM.java      27 Aug 2002 05:34:09 -0000      1.5
  @@ -160,6 +160,18 @@
        */
       public Object oneTransition (QName elementName, int[] currentState, 
SubstitutionGroupHandler subGroupHandler) {
   
  +        // error state
  +        if (currentState[0] < 0) {
  +            currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
  +            Object matchingDecl = null;
  +            for (int i = 0; i < fNumElements; i++) {
  +                matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, 
fAllElements[i]);
  +                if (matchingDecl != null)
  +                    break;
  +            }
  +            return matchingDecl;
  +        }
  +
           Object matchingDecl = null;
   
           for (int i = 0; i < fNumElements; i++) {
  
  
  
  1.5       +2 -2      
xml-xerces/java/src/org/apache/xerces/impl/xs/models/XSEmptyCM.java
  
  Index: XSEmptyCM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/models/XSEmptyCM.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XSEmptyCM.java    9 Aug 2002 15:18:19 -0000       1.4
  +++ XSEmptyCM.java    27 Aug 2002 05:34:09 -0000      1.5
  @@ -109,7 +109,7 @@
       public Object oneTransition (QName elementName, int[] currentState, 
SubstitutionGroupHandler subGroupHandler){
   
           // error state
  -        if (currentState[0] == XSCMValidator.FIRST_ERROR) {
  +        if (currentState[0] < 0) {
               currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
               return null;
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to