def visit_document(self, node: Element) -> None:
    self.footnotestack.append(self.collect_footnotes(node))
    self.curfilestack.append(node.get('docname', ''))
    if ('docname' in node):
        self.add_anchor(':doc', node)
def visit_document(self, node: Element) -> None:
    self.footnotestack.append(self.collect_footnotes(node))
    self.curfilestack.append(node.get('docname', ))
    if ('docname' in node):
        self.add_anchor(':doc', node)