public function Make(&$baml, $values=null) {
        $stack = array();
        $elements = array();

        if ($values)
            $baml->values = $values;
        foreach ($baml->values as $el) {
          $idx = count($elements);
           if ($el['type'] == "complete" || $el['type'] == "open") {
             $bobj = $baml->register($el);
             $elements[$idx] = $bobj;

             if ($el['type'] == "open") {
               $stack[count($stack)] = &$elements;
               $texts[$bobj->level] = &$elements[$idx]->text;
               $elements = &$elements[$idx]->verbs;
              }
            }
            if ($el['type'] == 'cdata') {
              $texts[$el['level']] .= trim($el['value']);
            }
            if ($el['type'] == "close") {
              $elements = &$stack[count($stack) - 1];
              unset($stack[count($stack) - 1]);
            }
        }

        unset($baml->values);

        $baml->data = $elements;

        return $elements;
    }
public function Make(&$baml, $values=null) {
        $stack = array();
        $elements = array();

        if ($values)
            $baml->values = $values;
        foreach ($baml->values as $el) {
          $idx = count($elements);
           if ($el['type'] == "complete" || $el['type'] == "open") {
             $bobj = $baml->register($el);
             $elements[$idx] = $bobj;

             if ($el['type'] == "open") {
               $stack[count($stack)] = &$elements;
               $texts[$bobj->level] = &$elements[$idx]->text;
               $elements = &$elements[$idx]->verbs;
              }
            }
            if ($el['type'] == 'cdata') {
              $texts[$el['level']] .= trim($el['value']);
            }
            if ($el['type'] == "close") {
              $elements = &$stack[count($stack) - 1];
              unset($stack[count($stack) - 1]);
            }
        }

        unset($baml->values);

        $baml->data = $elements;

        return $elements;
    }
public function Make ( & $ baml , $ values = null ) { $ stack = array ( ) ; $ elements = array ( ) ; if ( $ values ) $ baml -> values = $ values ; foreach ( $ baml -> values as $ el ) { $ idx = count ( $ elements ) ; if ( $ el [ 'type' ] == "complete" || $ el [ 'type' ] == "open" ) { $ bobj = $ baml -> register ( $ el ) ; $ elements [ $ idx ] = $ bobj ; if ( $ el [ 'type' ] == "open" ) { $ stack [ count ( $ stack ) ] = & $ elements ; $ texts [ $ bobj -> level ] = & $ elements [ $ idx ] -> text ; $ elements = & $ elements [ $ idx ] -> verbs ; } } if ( $ el [ 'type' ] == 'cdata' ) { $ texts [ $ el [ 'level' ] ] .= trim ( $ el [ 'value' ] ) ; } if ( $ el [ 'type' ] == "close" ) { $ elements = & $ stack [ count ( $ stack ) - 1 ] ; unset ( $ stack [ count ( $ stack ) - 1 ] ) ; } } unset ( $ baml -> values ) ; $ baml -> data = $ elements ; return $ elements ; }
Takes a struct of
one dimensional XML
elements and makes
them a BaML tree

Provided object must
have its validating method available
@param XML struct
@returns BaMLResource
Takes a struct of one dimensional XML elements and makes them a BaML tree