You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/01/23 21:59:25 UTC

svn commit: r614665 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: opti/SchemaDOMParser.java opti/SchemaParsingConfig.java traversers/XSDHandler.java

Author: mrglavas
Date: Wed Jan 23 12:59:17 2008
New Revision: 614665

URL: http://svn.apache.org/viewvc?rev=614665&view=rev
Log:
Cleaning up the implementation of SchemaDOMParser. We were creating two
instances of this class; one which just forwarded calls to SchemaParsingConfig
and another which did the actual work. We only create one instance now.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaParsingConfig.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java?rev=614665&r1=614664&r2=614665&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java Wed Jan 23 12:59:17 2008
@@ -77,6 +77,9 @@
     /** Default constructor. */
     public SchemaDOMParser(XMLParserConfiguration config) {
         this.config = config;
+        config.setDocumentHandler(this);
+        config.setDTDHandler(this);
+        config.setDTDContentModelHandler(this);
     }
     
     // Reference to the current annotation element.
@@ -521,14 +524,6 @@
      */
     public void parse(XMLInputSource inputSource) throws IOException {
         config.parse(inputSource);
-    }
-    
-    /**
-     * Gets the document from SchemaParsingConfig
-     * @return Document
-     */
-    public Document getDocument2() {
-    	return ((SchemaParsingConfig)config).getDocument();
     }
     
     /**

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaParsingConfig.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaParsingConfig.java?rev=614665&r1=614664&r2=614665&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaParsingConfig.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaParsingConfig.java Wed Jan 23 12:59:17 2008
@@ -692,14 +692,6 @@
      */
     public void reset() throws XNIException {
         
-        // set handlers
-        if (fSchemaDOMParser == null) {
-            fSchemaDOMParser = new SchemaDOMParser(this);
-        }
-        fDocumentHandler = fSchemaDOMParser;
-        fDTDHandler = fSchemaDOMParser;
-        fDTDContentModelHandler = fSchemaDOMParser;
-        
         // initialize the common components
         super.reset();
         
@@ -985,11 +977,6 @@
     //
     // other methods
     //
-    
-    /** Returns the Document object. */
-    public Document getDocument() {
-        return fSchemaDOMParser.getDocument();
-    }
     
     /** */
     public void resetNodePool() {

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=614665&r1=614664&r2=614665&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Wed Jan 23 12:59:17 2008
@@ -1801,7 +1801,8 @@
                 }
                 
                 fSchemaParser.parse(schemaSource);
-                schemaElement = fSchemaParser.getDocument2() == null ? null: DOMUtil.getRoot(fSchemaParser.getDocument2());
+                Document schemaDocument = fSchemaParser.getDocument();
+                schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null;
                 
                 // now we need to store the mapping information from system id
                 // to the document. also from the document to the system id.



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