Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / src / data / reader / Xml.js
index 35f74cb..a09db3a 100644 (file)
@@ -168,6 +168,10 @@ Ext.define('Ext.data.reader.Xml', {
     alternateClassName: 'Ext.data.XmlReader',
     alias : 'reader.xml',
     
+    /**
+     * @cfg {String} record The DomQuery path to the repeated element which contains record information.
+     */
+
     /**
      * @private
      * Creates a function to return some particular key of data from a response. The totalProperty and
@@ -175,39 +179,24 @@ Ext.define('Ext.data.reader.Xml', {
      * @param {String} key
      * @return {Function}
      */
-
-    /**
-     * @cfg {String} record The DomQuery path to the repeated element which contains record information.
-     */
-
-    createAccessor: function() {
-        var selectValue = function(expr, root){
+    createAccessor: function(expr) {
+        var me = this;
+        
+        if (Ext.isEmpty(expr)) {
+            return Ext.emptyFn;
+        }
+        
+        if (Ext.isFunction(expr)) {
+            return expr;
+        }
+        
+        return function(root) {
             var node = Ext.DomQuery.selectNode(expr, root),
-                val;
+                val = me.getNodeValue(node);
                 
-            
-            
-        };
-
-        return function(expr) {
-            var me = this;
-            
-            if (Ext.isEmpty(expr)) {
-                return Ext.emptyFn;
-            }
-            
-            if (Ext.isFunction(expr)) {
-                return expr;
-            }
-            
-            return function(root) {
-                var node = Ext.DomQuery.selectNode(expr, root),
-                    val = me.getNodeValue(node);
-                    
-                return Ext.isEmpty(val) ? null : val;
-            };
+            return Ext.isEmpty(val) ? null : val;
         };
-    }(),
+    },
     
     getNodeValue: function(node) {
         var val;