xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ne...@apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/validators/schema TraverseSchema.java
Date Mon, 05 Feb 2001 22:32:27 GMT
neilg       01/02/05 14:32:27

  Modified:    java/src/org/apache/xerces/validators/schema
                        TraverseSchema.java
  Log:
  A sereies of bugfixes and clean-ups.  Among other things, this makes sure we actually traverse
global or included attributeGroup declarations; also fixes a bug where the parser would die
if one extended a complexType contianing only attributes from another schema.
  
  Revision  Changes    Path
  1.94      +10 -7     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.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- TraverseSchema.java	2001/02/02 20:52:50	1.93
  +++ TraverseSchema.java	2001/02/05 22:32:27	1.94
  @@ -121,7 +121,7 @@
    *  
    * @see org.apache.xerces.validators.common.Grammar
    *
  - * @version $Id: TraverseSchema.java,v 1.93 2001/02/02 20:52:50 neilg Exp $
  + * @version $Id: TraverseSchema.java,v 1.94 2001/02/05 22:32:27 neilg Exp $
    */
   public class TraverseSchema implements 
                               NamespacesScope.NamespacesHandler{
  @@ -392,7 +392,7 @@
           
           //REVISIT, really sticky when noTargetNamesapce, for now, we assume everyting is
in the same name space);
           if (fTargetNSURI == StringPool.EMPTY_STRING) {
  -            fElementDefaultQualified = true;
  +            //fElementDefaultQualified = true;
               //fAttributeDefaultQualified = true;
           }
   
  @@ -419,7 +419,7 @@
               } else if (name.equals(SchemaSymbols.ELT_ELEMENT )) { 
                   traverseElementDecl(child);
               } else if (name.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
  -                //traverseAttributeGroupDecl(child);
  +                traverseAttributeGroupDecl(child, null, null);
               } else if (name.equals( SchemaSymbols.ELT_ATTRIBUTE ) ) {
                   traverseAttributeDecl( child, null, false );
               } else if (name.equals(SchemaSymbols.ELT_GROUP)) {
  @@ -715,11 +715,11 @@
               } else if (name.equals(SchemaSymbols.ELT_ELEMENT )) { 
                   traverseElementDecl(child);
               } else if (name.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
  -                //traverseAttributeGroupDecl(child);
  +                traverseAttributeGroupDecl(child, null, null);
               } else if (name.equals( SchemaSymbols.ELT_ATTRIBUTE ) ) {
                   traverseAttributeDecl( child, null , false);
  -            } else if (name.equals(SchemaSymbols.ELT_GROUP) && child.getAttribute(SchemaSymbols.ATT_REF).equals(""))
{
  -                //traverseGroupDecl(child);
  +            } else if (name.equals(SchemaSymbols.ELT_GROUP)) {
  +                traverseGroupDecl(child);
               } else if (name.equals(SchemaSymbols.ELT_NOTATION)) {
                   ; //TO DO
               }
  @@ -1851,7 +1851,7 @@
                  if (!isAttrOrAttrGroup(content)) {
                      throw new ComplexTypeRecoverableError(
                                "Only annotations and attributes are allowed in the " +
  -                             "content of an EXTENSION element for a complexType"); 
  +                             "content of an EXTENSION element for a complexType with simpleContent");

                  }
                  else {
                      attrNode = content;
  @@ -2547,6 +2547,9 @@
                || (ctsp.type & 0x0f) == ctsp.CONTENTSPECNODE_ANY_OTHER ) {
               return fSchemaGrammar.addContentSpecNode(ctsp.type, ctsp.value, ctsp.otherValue,
false);
           }
  +		else if (ctsp.type == -1) 
  +			// case where type being extended has no content
  +			return -2;
           else {
               if ( ctsp.value == -1 ) {
                   left = -1;
  
  
  

Mime
View raw message