[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-cvs
Subject:    cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/traversers XSDocumentInfo.java XSDHandler.
From:       sandygao () apache ! org
Date:       2002-01-29 20:24:58
[Download RAW message or body]

sandygao    02/01/29 12:24:57

  Modified:    java/src/org/apache/xerces/impl/xs/traversers
                        XSDocumentInfo.java XSDHandler.java
  Log:
  Bug in XSDHandler: convert null to "" before adding a namespace to a vector.
  
  Revision  Changes    Path
  1.8       +9 -1      \
xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java  
  Index: XSDocumentInfo.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSDocumentInfo.java	29 Jan 2002 01:15:16 -0000	1.7
  +++ XSDocumentInfo.java	29 Jan 2002 20:24:57 -0000	1.8
  @@ -77,7 +77,7 @@
    * affect the contents of that schema document alone.
    *
    * @author Neil Graham, IBM
  - * @version $Id: XSDocumentInfo.java,v 1.7 2002/01/29 01:15:16 lehors Exp $
  + * @version $Id: XSDocumentInfo.java,v 1.8 2002/01/29 20:24:57 sandygao Exp $
    */
   class XSDocumentInfo {
   
  @@ -177,4 +177,12 @@
           return fTargetNamespace == null?"no targetNamspace":"targetNamespace is " \
+ fTargetNamespace;  }
   
  +    public void addAllowedNS(String namespace) {
  +        fImportedNS.addElement(namespace == null ? "" : namespace);
  +    }
  +    
  +    public boolean isAllowedNS(String namespace) {
  +        return fImportedNS.contains(namespace == null ? "" : namespace);
  +    }
  +    
   } // XSDocumentInfo
  
  
  
  1.20      +4 -4      \
xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java  
  Index: XSDHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XSDHandler.java	29 Jan 2002 01:15:16 -0000	1.19
  +++ XSDHandler.java	29 Jan 2002 20:24:57 -0000	1.20
  @@ -101,7 +101,7 @@
    * schema, other grammars may be constructed as a side-effect.
    *
    * @author Neil Graham, IBM
  - * @version $Id: XSDHandler.java,v 1.19 2002/01/29 01:15:16 lehors Exp $
  + * @version $Id: XSDHandler.java,v 1.20 2002/01/29 20:24:57 sandygao Exp $
    */
   
   public class XSDHandler {
  @@ -490,7 +490,7 @@
           // are valid
           
           // a schema document can always access it's own target namespace
  -        currSchemaInfo.fImportedNS.addElement(currSchemaInfo.fTargetNamespace);
  +        currSchemaInfo.addAllowedNS(currSchemaInfo.fTargetNamespace);
   
           if (fGrammarBucket.getGrammar(currSchemaInfo.fTargetNamespace) == null) {
               SchemaGrammar sg = new SchemaGrammar(fSymbolTable, \
currSchemaInfo.fTargetNamespace);  @@ -535,7 +535,7 @@
                   }
                   fAttributeChecker.returnAttrArray(includeAttrs, currSchemaInfo);
                   // a schema document can access it's imported namespaces
  -                currSchemaInfo.fImportedNS.addElement(schemaNamespace);
  +                currSchemaInfo.addAllowedNS(schemaNamespace);
                   // consciously throw away whether was a duplicate; don't care.
                   // pass the systemId of the current document as the base systemId
                   newSchemaRoot = getSchema(schemaNamespace, schemaHint, \
(String)fDoc2SystemId.get(schemaRoot), false, XSDDescription.CONTEXT_IMPORT);  @@ \
-891,7 +891,7 @@  }
   
           // now check whether this document can access the requsted namespace
  -        if (!currSchema.fImportedNS.contains(declToTraverse.uri)) {
  +        if (!currSchema.isAllowedNS(declToTraverse.uri)) {
               // cannot get to this schema from the one containing the requesting \
                decl
               reportSchemaError("src-resolve.4", new \
Object[]{fDoc2SystemId.get(currSchema.fSchemaDoc), declToTraverse.uri});  return \
null;  
  
  

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic