Author: jgbutler
Date: Thu Apr  5 09:56:58 2007
New Revision: 525875

URL: http://svn.apache.org/viewvc?view=rev&rev=525875
Log:
Abator: Further improvements to the parser

Modified:
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties
    ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt
    
ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/xml/AbatorConfigurationParser.java

Modified: 
ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties?view=diff&rev=525875&r1=525874&r2=525875
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties 
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/build/version.properties 
Thu Apr  5 09:56:58 2007
@@ -1,4 +1,4 @@
 #Abator build version info
-#Wed Mar 07 13:22:36 CST 2007
+#Tue Apr 03 18:28:50 CDT 2007
 version=1.0.1
-buildNum=345
+buildNum=356

Modified: 
ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt?view=diff&rev=525875&r1=525874&r2=525875
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt 
(original)
+++ ibatis/trunk/java/mapper/mapper2/tools/abator/core/doc/ReleaseNotes.txt Thu 
Apr  5 09:56:58 2007
@@ -1,10 +1,12 @@
 -------------------------------------------------------------------------------
-Version 1.0.1:
+Version 1.1.0:
 Bugs - 
 1. corner case where the new "by example" methods fail if a criteria
    class has been added to the list, but there are no criteria set
 2. trimStrings on JavaModelGenerator not working
 3. Fix the XML file merger so that entities are preserved
+4. Fixed the configuration parser so that it correctly deals with
+   external entities
 
 Enhancements - 
 1. IBATIS-348 - escape column names with $ or #, and ignore special characters

Modified: 
ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/xml/AbatorConfigurationParser.java
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/xml/AbatorConfigurationParser.java?view=diff&rev=525875&r1=525874&r2=525875
==============================================================================
--- 
ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/xml/AbatorConfigurationParser.java
 (original)
+++ 
ibatis/trunk/java/mapper/mapper2/tools/abator/core/src/org/apache/ibatis/abator/config/xml/AbatorConfigurationParser.java
 Thu Apr  5 09:56:58 2007
@@ -46,6 +46,7 @@
 import org.apache.ibatis.abator.internal.util.StringUtility;
 import org.apache.ibatis.abator.internal.util.messages.Messages;
 import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -142,19 +143,12 @@
                 throw new XMLParserException(parseErrors);
             }
 
-            AbatorConfiguration ac = null;
-            Node rootNode = document.getFirstChild();
-            while (rootNode != null) {
-                if (rootNode.getNodeType() == 1
-                        && 
"abatorConfiguration".equals(rootNode.getNodeName())) { //$NON-NLS-1$
-                    ac = parseAbatorConfiguration(rootNode);
-                    break;
-                } else {
-                    rootNode = rootNode.getNextSibling();
-                }
-            }
-            
-            if (ac == null) {
+            AbatorConfiguration ac;
+            Element rootNode = document.getDocumentElement();
+            if (rootNode.getNodeType() == 1
+                    && "abatorConfiguration".equals(rootNode.getNodeName())) { 
//$NON-NLS-1$
+                ac = parseAbatorConfiguration(rootNode);
+            } else {
                 throw new 
XMLParserException(Messages.getString("RuntimeError.5")); //$NON-NLS-1$
             }
             
@@ -169,7 +163,7 @@
         }
     }
 
-    private AbatorConfiguration parseAbatorConfiguration(Node node) throws 
XMLParserException {
+    private AbatorConfiguration parseAbatorConfiguration(Element node) throws 
XMLParserException {
 
         AbatorConfiguration abatorConfiguration = new AbatorConfiguration();
 


Reply via email to