'use strict';
/* globals Node */
-var TEXT_NODE = Node.TEXT_NODE;
-
-
var DocumentNode = function(nativeNode, document) {
if(!document) {
},
getPath: function(ancestor) {
+ if(!(this.document.containsNode(this))) {
+ return null;
+ }
+
var nodePath = [this].concat(this.parents()),
toret, idx;
ancestor = ancestor || this.document.root;
this._nodeTransformations = {};
this._textNodeTransformations = {};
this._elementNodeTransformations = {};
+
+ this.registerExtension(coreTransformations);
};
$.extend(Document.prototype, Backbone.Events, {
return {
documentFromXML: function(xml) {
var doc = new Document(xml);
- doc.registerExtension(coreTransformations);
return doc;
},