xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From el...@apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/validators/schema TraverseSchema.java
Date Fri, 09 Feb 2001 20:28:20 GMT
elena       01/02/09 12:28:19

  Modified:    java/src/org/apache/xerces/validators/schema
                        TraverseSchema.java
  Log:
  <any> and <anyAttribute> bug fixes
  
  Revision  Changes    Path
  1.97      +16 -6     xml-xerces/java/src/org/apache/xerces/validators/schema/TraverseSchema.java
  
  Index: TraverseSchema.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/schema/TraverseSchema.java,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- TraverseSchema.java	2001/02/07 15:08:49	1.96
  +++ TraverseSchema.java	2001/02/09 20:28:19	1.97
  @@ -124,7 +124,7 @@
    *  
    * @see org.apache.xerces.validators.common.Grammar
    *
  - * @version $Id: TraverseSchema.java,v 1.96 2001/02/07 15:08:49 elena Exp $
  + * @version $Id: TraverseSchema.java,v 1.97 2001/02/09 20:28:19 elena Exp $
    */
   public class TraverseSchema implements 
                               NamespacesScope.NamespacesHandler{
  @@ -1197,7 +1197,11 @@
           if (namespace.length() == 0 || namespace.equals("##any")) {
               // REVISIT: Should the "any" namespace signifier also be changed
               //          to StringPool.EMPTY_STRING instead of -1? -Ac
  -            anyIndex = fSchemaGrammar.addContentSpecNode(processContentsAny, -1, -1, false);
  +            // REVISIT: is this the right way to do it? EMPTY_STRING does not 
  +            //          seem to work in this case -el 
  +            String uri = child.getOwnerDocument().getDocumentElement().getAttribute("targetNamespace");
  +            int uriIndex = fStringPool.addSymbol(uri);
  +            anyIndex = fSchemaGrammar.addContentSpecNode(processContentsAny, -1, uriIndex,
false);
           }
           else if (namespace.equals("##other")) {
               String uri = child.getOwnerDocument().getDocumentElement().getAttribute("targetNamespace");
  @@ -2388,6 +2392,7 @@
               } 
               else if ( childName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP) ) { 
                   traverseAttributeGroupDecl(child,typeInfo,anyAttDecls);
  +
               }
               else if ( childName.equals(SchemaSymbols.ELT_ANYATTRIBUTE) ) { 
                   attWildcard = traverseAnyAttribute(child);
  @@ -2412,8 +2417,10 @@
           }
           else {
               //REVISIT: unclear in the Scheme Structures 4.3.3 what to do in this case
  +            if (anyAttDecls.size()>0) {
  +                attWildcard = (XMLAttributeDecl)anyAttDecls.elementAt(0);
  +            }
           }
  -
           //
           // merge in base type's attribute decls
           //
  @@ -3089,7 +3096,8 @@
       * 
       */
       private int traverseAttributeGroupDecl( Element attrGrpDecl, ComplexTypeInfo typeInfo,
Vector anyAttDecls ) throws Exception {
  -        // attribute name
  +        // REVISIT: we are traversing Group decl each time it is referenced over and over
again
  +        // do we really want to do it?!
           int attGrpName = fStringPool.addSymbol(attrGrpDecl.getAttribute(SchemaSymbols.ATT_NAME));
           
           String ref = attrGrpDecl.getAttribute(SchemaSymbols.ATT_REF); 
  @@ -3140,7 +3148,9 @@
                   traverseAttributeGroupDecl(child, typeInfo,anyAttDecls);
               }
               else if ( child.getLocalName().equals(SchemaSymbols.ELT_ANYATTRIBUTE) ) {
  -                anyAttDecls.addElement(traverseAnyAttribute(child));
  +                if (anyAttDecls != null) { 
  +                     anyAttDecls.addElement(traverseAnyAttribute(child));
  +                }
                   break;
               }
               else if (child.getLocalName().equals(SchemaSymbols.ELT_ANNOTATION) ) {
  @@ -3725,9 +3735,9 @@
           else if ( !isQName.equals(SchemaSymbols.ATTVAL_UNQUALIFIED) &&
                   	(( isQName.equals(SchemaSymbols.ATTVAL_QUALIFIED)||
                      		fElementDefaultQualified ))) {
  +            
               uriIndex = fTargetNSURI;
           }
  -        
           //There can never be two elements with the same name and different type in the
same scope.
           int existSuchElementIndex = fSchemaGrammar.getElementDeclIndex(uriIndex, localpartIndex,
enclosingScope);
           if ( existSuchElementIndex > -1) {
  
  
  

Mime
View raw message