You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2001/06/05 17:05:42 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/validators/common ElementWildcard.java

sandygao    01/06/05 08:05:41

  Modified:    java/src/org/apache/xerces/validators/common
                        ElementWildcard.java
  Log:
  no message
  
  Revision  Changes    Path
  1.4       +15 -8     xml-xerces/java/src/org/apache/xerces/validators/common/ElementWildcard.java
  
  Index: ElementWildcard.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/common/ElementWildcard.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElementWildcard.java	2001/05/31 15:09:45	1.3
  +++ ElementWildcard.java	2001/06/05 15:05:39	1.4
  @@ -81,13 +81,15 @@
           int type = wtype & 0x0f;
   
           if (type == XMLContentSpec.CONTENTSPECNODE_ANY) {
  -                return true;
  +            return true;
           }
           else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_NS) {
  +            // TO BE DONE: substitution of "uri" satisfies "wtype:wildcard"
               if (uri == wildcard)
                   return true;
           }
           else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
  +            // TO BE DONE: substitution of "uri" satisfies "wtype:wildcard"
               if (wildcard != uri)
                   return true;
           }
  @@ -113,8 +115,7 @@
   
           // if both are "##other", and equal, then intersects
           if (type1 == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER &&
  -            type2 == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER &&
  -            w1 == w2) {
  +            type2 == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
               return true;
           }
   
  @@ -142,12 +143,18 @@
   
           if (type1 == XMLContentSpec.CONTENTSPECNODE_LEAF &&
               type2 == XMLContentSpec.CONTENTSPECNODE_LEAF) {
  -            try {
  -                if (comparator.isEquivalentTo(q1, q2) ||
  -                    comparator.isEquivalentTo(q2, q1))
  +            if (comparator != null) {
  +                try {
  +                    if (comparator.isEquivalentTo(q1, q2) ||
  +                        comparator.isEquivalentTo(q2, q1))
  +                        return true;
  +                } catch (Exception e) {
  +                    // error occurs in comparator, do nothing here.
  +                }
  +            } else {
  +                if (q1.localpart == q2.localpart &&
  +                    q1.uri == q2.uri)
                       return true;
  -            } catch (Exception e) {
  -                // error occurs in comparator, do nothing here.
               }
           } else if (type1 == XMLContentSpec.CONTENTSPECNODE_LEAF) {
               if (uriInWildcard(uri1, uri2, type2))
  
  
  

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