protected function startElement($parser, string $name, array $attrs): void
    {
        $newattrs = [];

        foreach ($attrs as $key => $value) {
            if (preg_match("/^\\$(\w+)$/", $value, $match)) {
                if (isset($this->vars[$match[1]]['id']) && !isset($this->vars[$match[1]]['gedcom'])) {
                    $value = $this->vars[$match[1]]['id'];
                }
            }
            $newattrs[$key] = $value;
        }
        $attrs = $newattrs;
        if ($this->process_footnote && ($this->process_ifs === 0 || $name === 'if') && ($this->process_gedcoms === 0 || $name === 'Gedcom') && ($this->process_repeats === 0 || $name === 'Facts' || $name === 'RepeatTag')) {
            $start_method = $name . 'StartHandler';
            $end_method   = $name . 'EndHandler';

            if (method_exists($this, $start_method)) {
                $this->$start_method($attrs);
            } elseif (!method_exists($this, $end_method)) {
                $this->htmlStartHandler($name, $attrs);
            }
        }
    }