Subject: [xml2rfc] Question about “tocInclude” in xml2rfc

From: Stuart Cheshire <[email-masked]>
Date: Wed, 03 Mar 2021 20:48:15 -0800

I have an Internet Draft that is quite short and doesn’t need a Table of Contents.

In the XML source, I set

    tocInclude="false"

but when I try to build it using xml2rfc 3.5.0 I get the errors below.

    Traceback (most recent call last):
      File "/Users/cheshire/Library/Python/3.7/bin/xml2rfc", line 8, in <module>
        sys.exit(main())
      File "/Users/cheshire/Library/Python/3.7/lib/python/site-packages/xml2rfc/run.py", line 739, in main
        writer.write(filename)
      File "/Users/cheshire/Library/Python/3.7/lib/python/site-packages/xml2rfc/writers/text.py", line 343, in write
        text = self.process()
      File "/Users/cheshire/Library/Python/3.7/lib/python/site-packages/xml2rfc/writers/text.py", line 300, in process
        self.add_pageno_placeholders()
      File "/Users/cheshire/Library/Python/3.7/lib/python/site-packages/xml2rfc/writers/text.py", line 372, in add_pageno_placeholders
        for e in toc.xpath('.//xref[2]'):
    AttributeError: 'NoneType' object has no attribute ‘xpath’

I tried using draft-davies-template-bare-07.xml (downloaded from <https://www.rfc-editor.org/materials/FAQ-xml2rfcv3.html>) and got the same problem. When I change “tocInclude” from “true” to “false” it gives the same errors.

If I try using the web-based tool at <https://xml2rfc.tools.ietf.org/> I get the same errors. The original draft-davies-template-bare-07.xml file works; when I change “tocInclude” from “true” to “false” it gives the same errors.

Any hints on how to fix this?

Stuart Cheshire