};
$.extend(ElementNode.prototype, {
+ nodeType: Node.ELEMENT_NODE,
+
getTagName: function() {
return this.nativeNode.tagName.toLowerCase();
},
this._$.contents().each(function() {
if(this.nodeType === Node.ELEMENT_NODE)
toret.push(new ElementNode(this));
+ else if(this.nodeType === Node.TEXT_NODE)
+ toret.push(new TextNode(this));
});
return toret;
},
});
+var TextNode = function(nativeNode) {
+ this.nativeNode = nativeNode;
+ this._$ = $(nativeNode);
+}
+
+$.extend(TextNode.prototype, {
+ nodeType: Node.TEXT_NODE
+})
+
+
return {
documentFromXML: function(xml) {
return new Document(parseXML(xml));