linting
[fnpeditor.git] / src / wlxml / wlxml.js
index 4af5e48..10a79ed 100644 (file)
@@ -24,16 +24,18 @@ $.extend(WLXMLElementNode.prototype, smartxml.ElementNode.prototype, {
     getMetaAttributes: function() {
         var toret = {};
         this.getAttrs().forEach(function(attr) {
-            if(isMetaAttribute(attr.name))
-                meta[attr.name.substr(5)] = attr.value;
+            if(isMetaAttribute(attr.name)) {
+                toret[attr.name.substr(5)] = attr.value;
+            }
         });
         return toret;
     },
     getOtherAttributes: function() {
         var toret = {};
         this.getAttrs().forEach(function(attr) {
-            if(attr.name != 'class' && !isMetaAttribute(attr.name))
+            if(attr.name !== 'class' && !isMetaAttribute(attr.name)) {
                 toret[attr.name] = attr.value;
+            }
         });
         return toret;
     }
@@ -52,7 +54,11 @@ $.extend(WLXMLDocument.prototype, {
 return {
     WLXMLDocumentFromXML: function(xml) {
         return new WLXMLDocument(xml);
-    }  
+    },
+
+    WLXMLElementNodeFromXML: function(xml) {
+        return this.WLXMLDocumentFromXML(xml).root;
+    }
 };
 
 });
\ No newline at end of file