define([
'libs/jquery',
'libs/underscore',
- 'smartxml/smartxml'
-], function($, _, smartxml) {
+ 'smartxml/smartxml',
+ 'smartxml/transformations'
+], function($, _, smartxml, transformations) {
'use strict';
}.bind(this));
return toret;
},
+ setMetaAttribute: function(key, value) {
+ this.setAttr('meta-'+key, value);
+ },
getOtherAttributes: function() {
var toret = {};
this.getAttrs().forEach(function(attr) {
}
});
-
+WLXMLElementNode.prototype.transformations.register(transformations.createContextTransformation({
+ name: 'wlxml.setMetaAttribute',
+ impl: function(args) {
+ this.setMetaAttribute(args.name, args.value);
+ },
+ getChangeRoot: function() {
+ return this.context;
+ }
+}));