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);
};
},
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