ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
63 stars 35 forks source link

Use of depercated tag "list" cause xml2rfc to crash. #1127

Open loghyr opened 3 weeks ago

loghyr commented 3 weeks ago

Describe the issue

To reproduce:

git clone git@github.com:loghyr/flexfilesv2.git cd flexfilesv2 make

Submit resulting file draft-haynes-nfsv4-flexfiles-v2-00.xml to https://author-tools.ietf.org/idnits

Or submit the following: (might have to rename to .xml) draft-haynes-nfsv4-flexfiles-v2-00.txt

Code of Conduct

kesara commented 3 weeks ago

@loghyr, This is a xml2rfc bug. The way https://author-tools.ietf.org/idnits works is, it creates a text file from the XML you submit. Because idints v2 only works with text files. You can use experimental idnits v3 to test XML files without converting to text under the hood.

The error you get is from xml2rfc:

root@4d23dc73e717:~/xml2rfc# xml2rfc draft-haynes-nfsv4-flexfiles-v2-00.xml
Warning: /root/xml2rfc/rfc2629-xhtml.ent is no longer needed as the special processing of non-ASCII characters has been superseded by direct support for non-ASCII characters in RFCXML.
Warning: /root/xml2rfc/rfc2629-xhtml.ent is no longer needed as the special processing of non-ASCII characters has been superseded by direct support for non-ASCII characters in RFCXML.
Warning: /root/xml2rfc/rfc2629-xhtml.ent is no longer needed as the special processing of non-ASCII characters has been superseded by direct support for non-ASCII characters in RFCXML.
Warning: /root/xml2rfc/rfc2629-xhtml.ent is no longer needed as the special processing of non-ASCII characters has been superseded by direct support for non-ASCII characters in RFCXML.
/root/xml2rfc/draft-haynes-nfsv4-flexfiles-v2-00.xml(18): Warning: Setting consensus="true" for IETF STD document (this is not the schema default, but is the only value permitted for this type of document)
/root/xml2rfc/draft-haynes-nfsv4-flexfiles-v2-00.xml(2599): Warning: Unused reference: There seems to be no reference to [RFC8435] in the document
/root/xml2rfc/draft-haynes-nfsv4-flexfiles-v2-00.xml(336): Warning: Was asked to render a deprecated element: <list>
    c: '<Element list at 0xffff9876cfe0>'
Traceback (most recent call last):
  File "/usr/local/bin/xml2rfc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/run.py", line 730, in main
    writer.write(filename)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 344, in write
    text = self.process()
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 302, in process
    lines = self.render(self.root, width=72, joiners=joiners)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 368, in render
    res = func(e, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 3064, in render_rfc
    lines = self.ljoin(lines, c, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 557, in ljoin
    res = mklines(self.render(e, width, **kwargs), e)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 368, in render
    res = func(e, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 2242, in render_middle
    lines = self.ljoin(lines, c, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 557, in ljoin
    res = mklines(self.render(e, width, **kwargs), e)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 368, in render
    res = func(e, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 3335, in render_section
    lines = self.ljoin(lines, c, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 557, in ljoin
    res = mklines(self.render(e, width, **kwargs), e)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 368, in render
    res = func(e, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 3767, in render_t
    text = self.inner_text_renderer(e)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 631, in inner_text_renderer
    text += self.render(c, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 368, in render
    res = func(e, width, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xml2rfc/writers/text.py", line 613, in default_renderer
    ctext = "\n\n".join(ctext)
TypeError: sequence item 0: expected str instance, Line found

Since this is a xml2rfc bug I'll move it there.

kesara commented 3 weeks ago

The error is caused by the <list> tag. It's deprecated in xml2rfc v3 vocabulary. You can use <ul> (unordered list) ^1 or <ol> (ordered list) ^2 instead.

cabo commented 3 weeks ago

The full error message is:

draft-haynes-nfsv4-flexfiles-v2-00.v2v3.xml(312): Warning: Was asked to render a deprecated element: <list>
    c: '<Element list at 0x10ab6c320>'
Traceback (most recent call last):
[…]
  File "/opt/homebrew/lib/python3.11/site-packages/xml2rfc/writers/text.py", line 371, in render
    res = func(e, width, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/xml2rfc/writers/text.py", line 616, in default_renderer
    ctext = "\n\n".join(ctext)
            ^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, Line found

*** xml2rfc failed, status 1 (possibly try with -r)

Workaround:

Delete line 17 of the XML file:

 version="3"

Now:

xml2rfc draft-haynes-nfsv4-flexfiles.xml

…works.

For a more compliant solution.

xml2rfc --v2v3 draft-haynes-nfsv4-flexfiles.xml
xml2rfc draft-haynes-nfsv4-flexfiles-v2v3.xml

(You can continue using the -v2v3 result as your XML file, or stick with simply using the XML file with the deleted version=“3”.)

Grüße, Carsten

On 14. Jun 2024, at 06:53, Tom Haynes @.***> wrote:

Describe the issue

To reproduce:

git clone @. @.>:loghyr/flexfilesv2.git cd flexfilesv2 make

Submit resulting file draft-haynes-nfsv4-flexfiles-v2-00.xml to https://author-tools.ietf.org/idnits

Or submit the following: (might have to rename to .xml) draft-haynes-nfsv4-flexfiles-v2-00.txt https://github.com/user-attachments/files/15813948/draft-haynes-nfsv4-flexfiles-v2-00.txt Code of Conduct

I agree to follow the IETF's Code of Conduct https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md — Reply to this email directly, view it on GitHub https://github.com/ietf-tools/xml2rfc/issues/1127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFUTVTBRPXSYEPXC2T3U3ZHJZNNAVCNFSM6AAAAABJJT4ZFOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2TENJQGE3DMOI. You are receiving this because you are subscribed to this thread.