1 /** 2 * @fileoverview A class implementing low-level update operations 3 * on XML tokens. 4 */ 5 6 goog.provide('xrx.update'); 7 8 9 10 goog.require('xrx.stream'); 11 goog.require('xrx.token'); 12 13 14 15 xrx.update = function(stream, token, string) { 16 var diff = string.length - token.length(); 17 18 stream.update(token.offset(), token.length(), string); 19 20 token.length(string.length); 21 22 23 24 return diff; 25 }; 26 27 28 xrx.update.notTag = function(stream, token, value) { 29 30 return xrx.update(stream, token, value); 31 }; 32 33 34 35 xrx.update.tagName = function(stream, token, name) { 36 37 return xrx.update(stream, token, name); 38 }; 39 40 41 42 xrx.update.attrValue = function(stream, token, value) { 43 44 return xrx.update(stream, token, value); 45 }; 46