1 if(typeof module !== 'undefined' && module.exports) {
2 var $ = require('jquery');
7 var transformations = {};
9 transformations.fromXML = {
10 getHTMLTree: function(xml) {
13 getMetaData: function(xml) {
15 $(xml).find('metadata').children().each(function() {
17 toret[this.nodeName.split(':')[1].toLowerCase()] = node.text();
21 getDocumentDescription: function(xml) {
23 HTMLTree: this.getHTMLTree(xml),
24 metadata: this.getMetaData(xml)
29 transformations.toXML = {
30 getXML: function(documentDescription) {
31 return documentDescription.HTMLTree;
36 if(typeof module !== 'undefined' && module.exports) {
37 module.exports = transformations;
39 rng.modules.visualEditor.transformations = transformations;