private function generateTmlTags($node) {
        $buffer = "";
        foreach($node->childNodes as $child) {
            if ($child->nodeType == 3) {                    // text node
                $buffer = $buffer . $child->wholeText;
            } else {
                $buffer = $buffer . $this->generateTmlTags($child);
            }
        }

        $token_context = $this->generateHtmlToken($node);
        $token = $this->adjustName($node);
        $token = $this->contextualize($token, $token_context);

        $value = $this->sanitizeValue($buffer);

        if ($this->isSelfClosingNode($node))
            return '{'.$token.'}';

        if ($this->isShortToken($token, $value))
            return '['.$token.': '.$value.']';

        return '['.$token.']'.$value.'[/'.$token.']';
    }
private function generateTmlTags($node) {
        $buffer = "";
        foreach($node->childNodes as $child) {
            if ($child->nodeType == 3) {                    // text node
                $buffer = $buffer . $child->wholeText;
            } else {
                $buffer = $buffer . $this->generateTmlTags($child);
            }
        }

        $token_context = $this->generateHtmlToken($node);
        $token = $this->adjustName($node);
        $token = $this->contextualize($token, $token_context);

        $value = $this->sanitizeValue($buffer);

        if ($this->isSelfClosingNode($node))
            return '{'.$token.'}';

        if ($this->isShortToken($token, $value))
            return '['.$token.': '.$value.']';

        return '['.$token.']'.$value.'[/'.$token.']';
    }
private function generateTmlTags ( $ node ) { $ buffer = "" ; foreach ( $ node -> childNodes as $ child ) { if ( $ child -> nodeType == 3 ) { // text node $ buffer = $ buffer . $ child -> wholeText ; } else { $ buffer = $ buffer . $ this -> generateTmlTags ( $ child ) ; } } $ token_context = $ this -> generateHtmlToken ( $ node ) ; $ token = $ this -> adjustName ( $ node ) ; $ token = $ this -> contextualize ( $ token , $ token_context ) ; $ value = $ this -> sanitizeValue ( $ buffer ) ; if ( $ this -> isSelfClosingNode ( $ node ) ) return '{' . $ token . '}' ; if ( $ this -> isShortToken ( $ token , $ value ) ) return '[' . $ token . ': ' . $ value . ']' ; return '[' . $ token . ']' . $ value . '[/' . $ token . ']' ; }
TML nodes can be nested - but they CANNOT contain non-inline nodes

@param $node
@return string
TML nodes can be nested - but they CANNOT contain non - inline nodes