1 /** 2 * @fileoverview A class representing the text node of the 3 * XDM interface. 4 */ 5 6 goog.provide('xrx.node.Text'); 7 8 9 10 goog.require('xrx.node'); 11 goog.require('xrx.token'); 12 goog.require('xrx.xpath.NodeSet'); 13 14 15 16 /** 17 * @constructor 18 */ 19 xrx.node.Text = function(pilot, token, parent, instance) { 20 goog.base(this, pilot, xrx.node.TEXT, token, instance); 21 this.parent_ = parent; 22 }; 23 goog.inherits(xrx.node.Text, xrx.node); 24 25 26 xrx.node.Text.prototype.accAttributes = function() {}; 27 xrx.node.Text.prototype.accBaseUri = function() {}; 28 xrx.node.Text.prototype.accChildren = function() {}; 29 xrx.node.Text.prototype.accDocumentUri = function() {}; 30 xrx.node.Text.prototype.accIsId = function() {}; 31 xrx.node.Text.prototype.accIsIdrefs = function() {}; 32 xrx.node.Text.prototype.accNamespaceNodes = function() {}; 33 xrx.node.Text.prototype.accNilled = function() {}; 34 xrx.node.Text.prototype.accNodeKind = function() {}; 35 xrx.node.Text.prototype.accNodeName = function() {}; 36 xrx.node.Text.prototype.accParent = function() {}; 37 xrx.node.Text.prototype.accStringValue = function() {}; 38 xrx.node.Text.prototype.accTypeName = function() {}; 39 xrx.node.Text.prototype.accTypedValue = function() {}; 40 xrx.node.Text.prototype.accUnparsedEntityPublicId = function() {}; 41 xrx.node.Text.prototype.accUnparsedEntitySystemId = function() {}; 42 43 44 45 /** 46 * @overwrite 47 */ 48 xrx.node.Text.prototype.getChildNodes = function() { 49 return new xrx.xpath.NodeSet(); 50 }; 51 52 53 54 /** 55 * @overwrite 56 */ 57 xrx.node.Text.prototype.getDescendantNodes = function() { 58 return new xrx.xpath.NodeSet(); 59 }; 60 61 62 63 /** 64 * @overwrite 65 */ 66 xrx.node.Text.prototype.getFollowingSiblingNodes = function(test) { 67 68 return this.parent_.find(test, xrx.label.prototype.isPrecedingSiblingOf); 69 }; 70 71 72 73 /** 74 * @overwrite 75 */ 76 xrx.node.Text.prototype.getFollowingNodes = function(test) { 77 78 return this.parent_.find(test, xrx.label.prototype.isBefore); 79 }; 80 81 82 83 /** 84 * @overwrite 85 */ 86 xrx.node.Text.prototype.getAttributeNodes = function() { 87 return new xrx.xpath.NodeSet(); 88 }; 89 90 91 92 /** 93 * @override 94 */ 95 xrx.node.Text.prototype.getParentNodes = function(test) { 96 var nodeset = new xrx.xpath.NodeSet(); 97 if (test.matches(this.parent_)) nodeset.add(this.parent_); 98 99 return nodeset; 100 }; 101 102 103 104 /** 105 * @overwrite 106 */ 107 xrx.node.Text.prototype.xml = function() { 108 return this.stringValue(); 109 }; 110 111 112 113 /** 114 * @overwrite 115 */ 116 xrx.node.Text.prototype.stringValue = function() { 117 return this.pilot_.xml(this.token_); 118 };