var DocumentNode = function(nativeNode, document) {
+ if(!document) {
+ throw new Error('undefined document for a node');
+ }
this.document = document;
this.nativeNode = nativeNode;
this._$ = $(nativeNode);
element1: parent.contents()[myIdx + (moveLeftRange ? -1 : 0)],
element2: parent.contents()[myIdx + childrenLength-1 + (moveRightRange ? 1 : 0)]
};
- }
+ },
+ toXML: function() {
+ var wrapper = $('<div>');
+ wrapper.append(this._$);
+ return wrapper.html();
+ }
});
var TextNode = function(nativeNode, document) {
createTextNode: function(nativeNode) {
return new this.TextNodeFactory(nativeNode, this);
+ },
+
+ toXML: function() {
+ return this.root.toXML();
}
});