You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ed...@apache.org on 2002/02/04 21:55:35 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/traversers XSDHandler.java

edwingo     02/02/04 12:55:35

  Modified:    java/src/org/apache/xerces/impl/xs/traversers
                        XSDHandler.java
  Log:
  Clean up duplicate code for proposed JAXP 1.2 "schemaSource" implementation.
  
  Revision  Changes    Path
  1.22      +5 -54     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XSDHandler.java	3 Feb 2002 18:07:46 -0000	1.21
  +++ XSDHandler.java	4 Feb 2002 20:55:35 -0000	1.22
  @@ -111,7 +111,7 @@
    * schema, other grammars may be constructed as a side-effect.
    *
    * @author Neil Graham, IBM
  - * @version $Id: XSDHandler.java,v 1.21 2002/02/03 18:07:46 edwingo Exp $
  + * @version $Id: XSDHandler.java,v 1.22 2002/02/04 20:55:35 edwingo Exp $
    */
   
   public class XSDHandler {
  @@ -411,57 +411,6 @@
           return fGrammarBucket.getGrammar(schemaNamespace);
       } // end parseSchema
   
  -    /**
  -     * REVISIT: Common code needs to be factored out and cleaned up.
  -     * XXX Temporary duplicate code to get JAXP SchemaLocation working.
  -     * Note: Does passing in null for target namespace cause any problems?
  -     * Can schemaNamespace be interned after call to constructTrees()?
  -     */
  -    public SchemaGrammar parseSchemaJAXP(XMLInputSource is) {
  -        short referType = XSDDescription.CONTEXT_PREPARSE;
  -        
  -        // first phase:  construct trees.
  -        Document schemaRoot = getSchema(null, is, true, referType);
  -        if (schemaRoot == null) {
  -            // something went wrong right off the hop
  -            return null;
  -        }
  -
  -        fRoot = constructTrees(schemaRoot, is.getSystemId(), /* ns */ null,
  -                               referType);
  -
  -        if (fRoot == null) {
  -            // REVISIT:  something went wrong; print error about no schema found
  -            return null;
  -        }
  -
  -        String schemaNamespace = fRoot.fTargetNamespace;
  -
  -        // handle empty string URI as null
  -        if (schemaNamespace != null) {
  -            schemaNamespace = fSymbolTable.addSymbol(schemaNamespace);
  -        }
  -
  -        // second phase:  fill global registries.
  -        buildGlobalNameRegistries();
  -
  -        // third phase:  call traversers
  -        traverseSchemas();
  -
  -        // fourth phase: handle local element decls
  -        traverseLocalElements();
  -
  -        // fifth phase:  handle Keyrefs
  -        resolveKeyRefs();
  -
  -        // sixth phase: validate attribute of non-schema namespaces
  -        // REVISIT: skip this for now. we reall don't want to do it.
  -        //fAttributeChecker.checkNonSchemaAttributes(fGrammarBucket);
  -
  -        // and return.
  -        return fGrammarBucket.getGrammar(schemaNamespace);
  -    }
  -
       // may wish to have setter methods for ErrorHandler,
       // EntityResolver...
   
  @@ -1387,7 +1336,8 @@
           Class componentType = val.getClass().getComponentType();
           if (componentType == null) {
               // Not an array
  -            parseSchemaJAXP(XSD2XMLInputSource(val, xer));
  +            parseSchema(null, XSD2XMLInputSource(val, xer),
  +                        XSDDescription.CONTEXT_PREPARSE);
               return ;
           } else if (componentType != Object.class) {
               // Not an Object[]
  @@ -1398,7 +1348,8 @@
   
           Object[] objArr = (Object[]) val;
           for (int i = 0; i < objArr.length; i++) {
  -            parseSchemaJAXP(XSD2XMLInputSource(objArr[i], xer));
  +            parseSchema(null, XSD2XMLInputSource(objArr[i], xer),
  +                        XSDDescription.CONTEXT_PREPARSE);
           }
       }
   
  
  
  

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