smartxml: setting text on text node
[fnpeditor.git] / src / smartxml / smartxml.js
index f4aa9fe..53eefed 100644 (file)
@@ -209,6 +209,10 @@ $.extend(TextNode.prototype, DocumentNode.prototype, {
         return this.nativeNode.data;
     },
 
+    setText: function(text) {
+        this.nativeNode.data = text;
+    },
+
     appendText: function(text) {
         this.nativeNode.data = this.nativeNode.data + text;
     },
@@ -242,10 +246,12 @@ $.extend(Document.prototype, Backbone.Events, {
         return new this.TextNodeFactory(nativeNode, this);
     },
 
-    loadXML: function(xml) {
+    loadXML: function(xml, options) {
+        options = options || {};
         defineDocumentProperties(this, $(parseXML(xml)));
-        
-        this.trigger('contentSet');
+        if(!options.silent) {
+            this.trigger('contentSet');
+        }
     },
 
     toXML: function() {