X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/989364fcf105797896a7172a4c9367f6b07848b2..198b0be1a6d1c67dd60d6d5a2b0472e1165e8168:/src/wlxml/wlxml.js?ds=sidebyside diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 9fb6a98..034312d 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -297,8 +297,9 @@ $.extend(WLXMLDocument.prototype, { registerClassTransformation: function(Transformation, className) { var thisClassTransformations = (this.classTransformations[className] = this.classTransformations[className] || {}); - thisClassTransformations[Transformation.prototype.name] = function(args) { + thisClassTransformations[Transformation.prototype.name] = function() { var nodeInstance = this; + var args = Array.prototype.slice.call(arguments, 0); return nodeInstance.transform(Transformation, args); }; }, @@ -342,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