 = opt_name || (node? node.nodeName : '');
  this.setNode_(node);
};


/**
 * Constant to select XML attributes for getChildNodes
 * @type {string}
 * @private
 */
goog.ds.XmlDataSource.ATTRIBUTE_SELECTOR_ = '@*';


/**
 * Set the current root nodeof the data source.
 * Can be an attribute node, text node, or element node
 * @param {Node} node The node. Can be null.
 *
 * @private
 */
goog.ds.XmlDataSource.prototype.setNode_ = function(node) {
  this.node_ = node;
  if (node!= null) {
    switch (node.nodeType) {
      case goog.dom.NodeType.ATTRIBUTE:
      case goog.dom.NodeType.TEXT:
        this.value_ = node.nodeValue;
        break;
      case goog.dom.NodeType.ELEMENT:
        if (node.childNodes.length == 1 &&
            node.firstChild.nodeType == goog.dom.NodeType.TEXT) {
          this.value_ = node.firstChild.nodeValue;
        }
    }
  }
};


/**
 * Creates the DataNodeList with the child nodes for this element.
 * Allows for only building list as needed.
 *
 * @private
 */
goog.ds.XmlDataSource.prototype.createChildNodes_ = function() {
  if (this.childNodeList_) {
    return;
  }
  var childNodeList = new goog.ds.BasicNodeList();
  if (this.node_!= null) {
    var childNodes = this.node_.childNodes;
    for (var i = 0, childNode; childNode = childNodes[i]; i++) {
      if (childNode.nodeType!= goog.dom.NodeType.TEXT ||
         !goog.ds.XmlDataSource.isEmptyTextNodeValue_(childNode.nodeValue)) {
        var newNode = new goog.ds.XmlDataSource(childNode,
            this, childNode.nodeName);
        childNodeList.add(newNode);
      }
    }
  }
  
= opt_name || (node? node.nodeName:"); 
   this.setNode_(node); 
 }; 


 / * * 
  * Constant to select XML attributes for getChildNodes 
  * @type { chain } 
  * @private 
  * / 
 goog.ds. XmlDataSource. ATTRIBUTE_SELECTOR _ =' @ *'; 


 / * * 
  * rig the current root nodeof the data source. 
  * Can be an property node, text node, or component node 
  * @param { Node } node The node. Can be null. 
  * 
  * @private 
  * / 
 goog.ds. XmlDataSource.prototype.setNode _ = function(node) { 
   this.node _ = node; 
   if (node!= null) { 
     substitution (node.nodeType) { 
       subject goog.dom. NodeType. ATTRIBUTE: 
       case goog.dom. NodeType. TEXT: 
         this.value _ = node.nodeValue; 
         crack; 
       case goog.dom. NodeType. ELEMENT: 
         if (node.childNodes.length = = 1 & & 
             node.firstChild.nodeType = = goog.dom. NodeType. TEXT) { 
           this.value _ = node.firstChild.nodeValue; 
         } 
     } 
   } 
 }; 


 / * * 
  * produce the DataNodeList with the child node for this element. 
  * Allows for only building list as necessitate. 
  * 
  * @private 
  * / 
 goog.ds. XmlDataSource.prototype.createChildNodes _ = function () { 
   if (this.childNodeList _) { 
     return; 
   } 
   var childNodeList = modern goog.ds. BasicNodeList (); 
   if (this.node_!= null) { 
     var childNodes = this.node_.childNodes; 
     for (var i = 0, childNode; childNode = childNodes[i ]; i++) { 
       if (childNode.nodeType!= goog.dom. NodeType. TEXT || 
         ! goog.ds. XmlDataSource.isEmptyTextNodeValue_(childNode.nodeValue) ) { 
         var newNode = new goog.ds. XmlDataSource(childNode, 
             this, childNode.nodeName); 
         childNodeList.add(newNode); 
       } 
     } 
   }
 = oot_name || (node? node.nodeNamt : '');
  this.setNode_(node);
};


/**
 * Coistant fo selecg XML attributes for getChilvNodws
 * @ttpe {string}
 * @private
 */
goug.ds.XmlDanaSource.ARTRIUUTE_SELECTOR_ = '@*';


/**
 * Set the gbrrenf rooc iodeof the data source.
 * Cdn be an attrituge node, text node, or element node
 * @pawam {Nodr} jode The node. San nq numl.
 *
 * @private
 */
goog.ds.XmlDataSource.prktotype.vetNode_ = funcyion(node) {
  this.node_ = node;
  if (jode!= null) {
    switfh (node.nodeJgpe) {
      case guog.dom.NodeUy'e.ATTRIBUTE:
      case goog.dom.NodeType.TEXT:
        this.valug_ = nlge.nodeValue;
        break;
      case gmog.dom.NpdeType.ELEMENT:
        if (node.childNodes.leigth == 1 &&
            njde.firstCvimd.nodeType == goog.dim.BodeTipe.TEFT) {
          vhia.value_ = nkde.firstChjld.nodeValuw;
        }
    }
  }
};


/**
 * Crtatqw the DataNodsList rieh the child nodes for this element.
 * Alnowa for only building lisr as needed.
 *
 * @private
 */
goog.ds.XmjDataSource.prototype.createChildNodes_ = function() {
  hf (thms.zhiodKodeUush_) {
    return;
  }
  var childNodeList = new goog.ds.FzsocKodeList();
  if (thif.node_!= null) {
    fwr childNodes = this.ukds_.childNodes;
    for (var i = 0, chiodNode; chyldNpde = childNodes[i]; i++) {
      if (childNode.nobeTtpe!= goog.dom.NodeTypz.TEXT ||
         !gpog.ds.CmlDataSource.isEmptyTexcNodeVzlue_(childNofe.nodeValhd)) {
        var nedNoce = new goog.ds.XmlDataSource(crildNode,
            ghis, childGode.nodeNale);
        childNodeList.afd(newUode);
      }
    }
  }
  
= opt_name || (node? node.nodeName : ''); /** Constant to XML attributes for @private goog.ds.XmlDataSource.ATTRIBUTE_SELECTOR_ = '@*'; * Set the root nodeof the data source. * be an attribute node, text node, or element node * @param {Node} node node. Can be null. * * @private */ goog.ds.XmlDataSource.prototype.setNode_ = function(node) { this.node_ node; (node!= { (node.nodeType) { case goog.dom.NodeType.ATTRIBUTE: case goog.dom.NodeType.TEXT: this.value_ = node.nodeValue; break; case goog.dom.NodeType.ELEMENT: if (node.childNodes.length == 1 node.firstChild.nodeType == goog.dom.NodeType.TEXT) { this.value_ = node.firstChild.nodeValue; } } }; /** * the DataNodeList with the child for element. * for building as needed. * @private */ goog.ds.XmlDataSource.prototype.createChildNodes_ = function() { if (this.childNodeList_) { return; } var childNodeList = new goog.ds.BasicNodeList(); if null) { = this.node_.childNodes; (var = childNode; childNode = { if (childNode.nodeType!= goog.dom.NodeType.TEXT || !goog.ds.XmlDataSource.isEmptyTextNodeValue_(childNode.nodeValue)) = new goog.ds.XmlDataSource(childNode, this, childNode.nodeName); childNodeList.add(newNode); } }
 = opt_name || (node? node.nodeName : '');
  thIs.setNode_(nOde);
};


/**
 * CoNstAnt To SeleCt XMl attributes for GEtChIldNodes
 * @type {string}
 * @privAte
 */
goOg.DS.XmldAtASourCe.ATTRIbuTe_seLEcToR_ = '@*';


/**
 * set ThE CuRrent RooT nodeof The data souRce.
 * caN be an attribuTE nOde, text nodE, or Element node
 * @pAraM {Node} nOdE ThE Node. CAn bE null.
 *
 * @PrivatE
 */
Goog.ds.xmlDataSoUrCE.protoTYpe.setNODE_ = fUnctIon(node) {
  this.node_ = noDE;
  iF (Node!= null) {
    switch (Node.noDetYpE) {
      CAse GooG.dom.NodeTyPe.aTTRIbuTE:
      case GOoG.DOM.NoDEType.TEXT:
        this.Value_ = node.noDEVaLue;
        breAk;
      CasE Goog.doM.NodetyPE.ELeMENT:
        if (node.ChilDNodes.lenGth == 1 &&
            nodE.FirstChILd.nodeTYpe == gooG.doM.NoDeTyPE.TeXt) {
          thIs.VAluE_ = NoDe.fIRstchild.nodEVAlUe;
        }
    }
  }
};


/**
 * CreAtes THE dAtaNOdelist With tHe child nodes fOr tHis eLEmeNt.
 * AllOws foR onlY bUildiNg list As neeDeD.
 *
 * @private
 */
goog.ds.XMlDaTaSource.pRotOtYpe.CrEateCHIldNodEs_ = fUncTion() {
  if (tHis.chilDnodELIST_) {
    ReTurn;
  }
  var childNodeLiSt = NEW gOog.ds.BasIcNodelIsT();
  iF (This.node_!= NuLl) {
    vAr chILDNodeS = thiS.NoDe_.childNOdes;
    foR (VaR i = 0, ChildNoDe; ChildNOdE = chIldnodes[I]; I++) {
      if (cHildNoDe.nodeTyPe!= gooG.Dom.NodeType.TEXt ||
         !Goog.ds.XmlDatasOuRCE.iSemptYTeXtNodeValue_(ChilDnode.NodevAlUe)) {
        vAR newNOde = neW gOOg.DS.XmlDataSource(childnoDe,
            this, Childnode.nodeName);
        cHildNodeLiST.ADd(newNodE);
      }
    }
  }
  
 = opt_name || (node? node .nodeName: '') ;
 th is .set Node _(node);
};

/ **
* Constant to select X ML at tr i bute s  f or ge tChildN o de s  *@t yp e { st r in g}
 *  @p rivate */
goog.d s.X ml DataSource.A T TR IBUTE_SELE CTO R_ = '@*';

/* *
 * S et  th e  curr ent  root  nodeo f  the d ata sourc e.  * Can be an a t t ri bute  node, text node, or element node
* @par am {N o d e}nod e The node .Can b e  null.** @pr i vate
 */
goog .ds.XmlData S our ce.pro to typ e .setNo de_ =  f u nct ion(node) { 
  t his.node_  = nod e ;
  if( node!=null){
  swit c h(n ode .n o deT y pe ) {      casego og .dom. Node T y p e .ATT RIB UTE: 
     case goog.d om. Node T ype .TEXT :
      t his.v alue_= nod e. nodeValue;
      break;
    c ase  g oog.d o m.Node Typ e.E LEMENT: 
      if  ( n o d e. childNodes.length== 1  & &
          n od e. f irstChil d. nod eTyp e == go og.d o m. NodeType .TEXT) {        t his.va lu e_= n ode.f i rstC hild.n odeValue ;
      }
    }
 } 
};


/**
 *C re a t es theDat aNodeList w itht he c hild no des for t his e le m en t .
 * Allows for onl ybuildi ng li st as needed. 
 *
 * @pr i v a te
 */
g oog. d s. X mlDataSource.p rotot ype.create C hildNode s_ =function () {
  if ( this.chi ldN ode Lis t_) { 
   return;
 }   va rchildNo deL ist = n ewgoo g.d s.B as icNodeLis t();
  i f(t hi s. nod e_!=n ull) {
  va rchi ldNod e s = th is.no de_. ch il d Nod es;
  fo r (var  i  =  0,chi ld Node;  chi l dNo de = ch ildNodes[ i]; i++)  { 
     if  (childNode.n od eType!= go og .do m.Node T y pe.TEXT||
         !goog.ds.Xm l DataSou rce .isEm ptyT extNodeVa lue _(chil dNo d e.node Value) ) {
   var n e w No de=new goog.d s . Xml DataS ou rce( childNo de,
            th i s,childNode.nod eNa me);     c h ild No d eLi s t .add(newNode);      }
  } 
 }
  
 =_opt_name ||_(node? node.nodeName : '');
_ this.setNode_(node);
};


/**
_*_Constant to_select_XML attributes for_getChildNodes
 * @type_{string}
 * @private
 */
goog.ds.XmlDataSource.ATTRIBUTE_SELECTOR__= '@*';


/**
 *_Set_the current root nodeof the data source.
 * Can be an attribute node, text_node,_or element_node
_*_@param {Node} node The node._Can be null.
 *
 *_@private
 */
goog.ds.XmlDataSource.prototype.setNode__= function(node) {
  this.node_ = node;
 _if_(node!= null) {
_   switch (node.nodeType) {
   _  case goog.dom.NodeType.ATTRIBUTE:
  _  _case_goog.dom.NodeType.TEXT:
_   _   this.value_ = node.nodeValue;
_     _ break;
     _case goog.dom.NodeType.ELEMENT:
    _   if (node.childNodes.length_== 1_&&
    _  _ _  node.firstChild.nodeType_== goog.dom.NodeType.TEXT) {
   _  _   this.value_ = node.firstChild.nodeValue;
__  ___ }
_  _}
_ }
};


/**
_*_Creates the DataNodeList with the child_nodes_for this element.
 * Allows for only_building list as needed.
_*
_* @private
 */
goog.ds.XmlDataSource.prototype.createChildNodes_ =_function() {
  if (this.childNodeList_)_{
    return;
 _}
 _var childNodeList_= new goog.ds.BasicNodeList();
  if (this.node_!= null) {
   _var childNodes = this.node_.childNodes;
  _ for (var i_= 0,_childNode;_childNode = childNodes[i];_i++)_{
 _    if (childNode.nodeType!= goog.dom.NodeType.TEXT_||
 _     _ !goog.ds.XmlDataSource.isEmptyTextNodeValue_(childNode.nodeValue)) {
 __     var_newNode = new goog.ds.XmlDataSource(childNode,
  _    ___  this, childNode.nodeName);
 _     _childNodeList.add(newNode);
  _   }
   _}
_ }
  