- registerDocumentTransformation: function(desc, name) {
- registerTransformation(desc, name, this);
- },
-
- registerNodeTransformation: function(desc, name) {
- registerTransformation(desc, name, this._nodeTransformations);
+ registerTransformation: function(desc, name, dstName) {
+ var doc = this;
+ var destination = {
+ document: doc,
+ documentNode: doc._nodeTransformations,
+ textNode: doc._textNodeTransformations,
+ elementNode: doc._elementNodeTransformations
+ }[dstName];
+ registerTransformation(desc, name, destination);