protected function renderNamespace($ns, $directives) {
        $ret = '';
        $ret .= $this->start('tbody', array('class' => 'namespace'));
        $ret .= $this->start('tr');
            $ret .= $this->element('th', $ns, array('colspan' => 2));
        $ret .= $this->end('tr');
        $ret .= $this->end('tbody');
        $ret .= $this->start('tbody');
        foreach ($directives as $directive => $value) {
            $ret .= $this->start('tr');
            $ret .= $this->start('th');
            if ($this->docURL) {
                $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL);
                $ret .= $this->start('a', array('href' => $url));
            }
                $attr = array('for' => "{$this->name}:$ns.$directive");

                // crop directive name if it's too long
                if (!$this->compress || (strlen($directive) < $this->compress)) {
                    $directive_disp = $directive;
                } else {
                    $directive_disp = substr($directive, 0, $this->compress - 2) . '...';
                    $attr['title'] = $directive;
                }

                $ret .= $this->element(
                    'label',
                    $directive_disp,
                    // component printers must create an element with this id
                    $attr
                );
            if ($this->docURL) $ret .= $this->end('a');
            $ret .= $this->end('th');

            $ret .= $this->start('td');
                $def = $this->config->def->info["$ns.$directive"];
                if (is_int($def)) {
                    $allow_null = $def < 0;
                    $type = abs($def);
                } else {
                    $type = $def->type;
                    $allow_null = isset($def->allow_null);
                }
                if (!isset($this->fields[$type])) $type = 0; // default
                $type_obj = $this->fields[$type];
                if ($allow_null) {
                    $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj);
                }
                $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config));
            $ret .= $this->end('td');
            $ret .= $this->end('tr');
        }
        $ret .= $this->end('tbody');
        return $ret;
    }