db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r378886 - /db/torque/generator/trunk/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
Date Sun, 19 Feb 2006 12:28:12 GMT
Author: tfischer
Date: Sun Feb 19 04:28:09 2006
New Revision: 378886

URL: http://svn.apache.org/viewcvs?rev=378886&view=rev
Log:
Modified the behaviour of the DTDResolver to match standard behaviour. 
The main difference is if no DTD is given: In this case,
- the new behaviour is not to use a dtd to vaidate the schema.xml.
- the old behaviour was to use the dtd from the generator jar.


Modified:
    db/torque/generator/trunk/src/java/org/apache/torque/engine/database/transform/DTDResolver.java

Modified: db/torque/generator/trunk/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/src/java/org/apache/torque/engine/database/transform/DTDResolver.java?rev=378886&r1=378885&r2=378886&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
(original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
Sun Feb 19 04:28:09 2006
@@ -77,12 +77,15 @@
 
     /**
      * An implementation of the SAX <code>EntityResolver</code>
-     * interface to be called by the XML parser.
+     * interface to be called by the XML parser.  If the dtd is the
+     * current Torque DTD, the DTD is read from the generator jar.
+     * In all other cases, null is returned to indicate that the parser 
+     * should open a regular connection to the systemId URI.
      *
      * @param publicId The public identifier of the external entity
      * @param systemId The system identifier of the external entity
      * @return An <code>InputSource</code> for the
-     * <code>database.dtd</code> file.
+     * <code>database.dtd</code> file in the generator jar, or null.
      */
     public InputSource resolveEntity(String publicId, String systemId)
             throws IOException
@@ -95,15 +98,10 @@
                      + pkg + "' package");
             return databaseDTD;
         }
-        else if (systemId == null || "".equals(systemId.trim()))
-        {
-            log.info("Resolver: used '" + WEB_SITE_DTD + '\'');
-            return getInputSource(WEB_SITE_DTD);
-        }
         else
         {
-            log.info("Resolver: used '" + systemId + '\'');
-            return getInputSource(systemId);
+            log.info("Resolver: used default behaviour");
+            return null;
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message