hsp/rt/cptcomponent.js
function() {
    var aen=this.attEltNodes;
    if (!aen) {
      return null;
    }
    var attElts=[], cta=this.ctlAttributes;
    for (var i=0,sz=aen.length; sz>i;i++) {
      aen[i].registerAttElements(attElts);
    }
    // check that all elements are valid (i.e. have valid names)
    var nm, elt, ok, elts=[], cte=this.ctlElements? this.ctlElements : [];
    for (var i=0,sz=attElts.length; sz>i; i++) {
      elt=attElts[i];
      nm=elt.name;
      ok=true;
      if (cta && cta[nm]) {
        // valid tpl attribute
        if (!this.tplAttributes) {
          this.tplAttributes={};
        }
        this.tplAttributes[nm]=elt;
        ok = false;
      } else {
        if (!nm) {
          log.error(this+" Invalid attribute element (unnamed)");
          ok=false;
        } else if (!cte[nm]) {
          log.error(this+" Invalid attribute element: @"+nm);
          ok=false;
        }
      }
      if (ok) {
        elts.push(elt);
      }
    }
    if (elts.length===0) {
      elts=null;
    }
    this.childElements=elts;
    return elts;
  }
function() {
    var aen=this.attEltNodes;
    if (!aen) {
      return null;
    }
    var attElts=[], cta=this.ctlAttributes;
    for (var i=0,sz=aen.length; sz>i;i++) {
      aen[i].registerAttElements(attElts);
    }
    // check that all elements are valid (i.e. have valid names)
    var nm, elt, ok, elts=[], cte=this.ctlElements? this.ctlElements : [];
    for (var i=0,sz=attElts.length; sz>i; i++) {
      elt=attElts[i];
      nm=elt.name;
      ok=true;
      if (cta && cta[nm]) {
        // valid tpl attribute
        if (!this.tplAttributes) {
          this.tplAttributes={};
        }
        this.tplAttributes[nm]=elt;
        ok = false;
      } else {
        if (!nm) {
          log.error(this+" Invalid attribute element (unnamed)");
          ok=false;
        } else if (!cte[nm]) {
          log.error(this+" Invalid attribute element: @"+nm);
          ok=false;
        }
      }
      if (ok) {
        elts.push(elt);
      }
    }
    if (elts.length===0) {
      elts=null;
    }
    this.childElements=elts;
    return elts;
  }
function ( ) { var aen = this . attEltNodes ; if ( ! aen ) { return null ; } var attElts = [ ] , cta = this . ctlAttributes ; for ( var i = 0 , sz = aen . length ; sz > i ; i ++ ) { aen [ i ] . registerAttElements ( attElts ) ; } // check that all elements are valid (i.e. have valid names) var nm , elt , ok , elts = [ ] , cte = this . ctlElements ? this . ctlElements : [ ] ; for ( var i = 0 , sz = attElts . length ; sz > i ; i ++ ) { elt = attElts [ i ] ; nm = elt . name ; ok = true ; if ( cta && cta [ nm ] ) { // valid tpl attribute if ( ! this . tplAttributes ) { this . tplAttributes = { } ; } this . tplAttributes [ nm ] = elt ; ok = false ; } else { if ( ! nm ) { log . error ( this + " Invalid attribute element (unnamed)" ) ; ok = false ; } else if ( ! cte [ nm ] ) { log . error ( this + " Invalid attribute element: @" + nm ) ; ok = false ; } } if ( ok ) { elts . push ( elt ) ; } } if ( elts . length === 0 ) { elts = null ; } this . childElements = elts ; return elts ; }
Retrieve all child attribute elements
and update the tplAttributes and childElements collections
Retrieve all child attribute elements and update the tplAttributes and childElements collections