wlxml: allow extending WLXMLDocument
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 24 Mar 2014 11:28:32 +0000 (12:28 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 28 Mar 2014 15:22:11 +0000 (16:22 +0100)
src/wlxml/wlxml.js

index 4f6e356..034312d 100644 (file)
@@ -343,14 +343,17 @@ var wlxmlClasses = {
 
 
 return {
-    WLXMLDocumentFromXML: function(xml, options) {
+    WLXMLDocumentFromXML: function(xml, options, Factory) {
         options = _.extend({wlxmlClasses: wlxmlClasses}, options);
-        return new WLXMLDocument(xml, options);
+        Factory = Factory || WLXMLDocument;
+        return new Factory(xml, options);
     },
 
     WLXMLElementNodeFromXML: function(xml) {
         return this.WLXMLDocumentFromXML(xml).root;
-    }
+    },
+
+    WLXMLDocument: WLXMLDocument
 };
 
 });
\ No newline at end of file