Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings and errors in documentation generation #139

Closed
ronaldtse opened this issue Apr 13, 2021 · 3 comments
Closed

Warnings and errors in documentation generation #139

ronaldtse opened this issue Apr 13, 2021 · 3 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@ronaldtse
Copy link
Contributor

We need to fix the crashing error below.

$ bundle exec metanorma site generate
[info]: Compiling /Users/me/src/mn/mn-samples-ietf/sources/antioch/document.adoc ...
...
Bibliography: (XML Line 000636): Reference grail_film is missing a document identifier (docid)
...
Metanorma XML Syntax: (XML Line 000103:88): attribute "obligation" not allowed here; expected attribute "language", "numbered", "removeInRFC", "script" or "toc"
Metanorma XML Syntax: (XML Line 000620:26): element "bibitem" not allowed here; expected the element end-tag or element "clause", "definitions" or "terms"
Metanorma XML Syntax: (XML Line 000682:33): element "passthrough" not allowed here; expected the element end-tag or element "bibitem", "note" or "references"
Metanorma XML Syntax: (XML Line 000682:33): found attribute "formats", but no attributes allowed here
Metanorma XML Syntax: (XML Line 000125:36): IDREF "RFC7990" without matching ID
...
 Created file /Users/me/src/mn/mn-samples-ietf/site/documents/antioch/document.txt
 Created file /Users/me/src/mn/mn-samples-ietf/site/documents/antioch/document.html
[info]: Compiling /Users/me/src/mn/mn-samples-ietf/sources/example/document.adoc ...
...
Document Attributes: IETF: unrecognised working group Network Working Group
Metanorma XML Syntax: (XML Line 000308:12): element "workgroup" not allowed here; expected the element end-tag or element "committee"
Metanorma XML Syntax: (XML Line 000318:88): attribute "obligation" not allowed here; expected attribute "language", "numbered", "removeInRFC", "script" or "toc"
/Users/me/src/mn/mn-samples-ietf/site/documents/example/document.rfc.xml(170): Warning: Removed a redundant ascii= attribute from <organization>
/Users/me/src/mn/mn-samples-ietf/site/documents/example/document.rfc.xml(173): Warning: Removed a redundant ascii= attribute from <organization>
/Users/me/src/mn/mn-samples-ietf/site/documents/example/document.rfc.xml(8): Warning: Expected a <link> with rel="prev" providing the datatracker url for the origin draft, or alternatively a "docName" attribute on <rfc> from which to construct such a <link> element.
 Created file /Users/me/src/mn/mn-samples-ietf/site/documents/example/document.txt
/Users/me/src/mn/mn-samples-ietf/site/documents/example/document.rfc.xml(170): Warning: Removed a redundant ascii= attribute from <organization>
/Users/me/src/mn/mn-samples-ietf/site/documents/example/document.rfc.xml(173): Warning: Removed a redundant ascii= attribute from <organization>
/Users/me/src/mn/mn-samples-ietf/site/documents/example/document.rfc.xml(8): Warning: Expected a <link> with rel="prev" providing the datatracker url for the origin draft, or alternatively a "docName" attribute on <rfc> from which to construct such a <link> element.
Traceback (most recent call last):
  File "/usr/local/bin/xml2rfc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/run.py", line 754, in main
    writer.write(filename)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 266, in write
    html_tree = self.html_tree()
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 244, in html_tree
    html_tree = self.render(None, self.root)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 664, in render_rfc
    self.render(body, c)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 335, in skip_renderer
    self.render(h, c)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 2235, in render_references
    self.render(hh, c)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 2136, in render_reference
    self.render(inner, c)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.9/site-packages/xml2rfc/writers/html.py", line 1162, in render_author
    if after_next.tag != 'author':
AttributeError: 'NoneType' object has no attribute 'tag'
[info]: Building collection file: /Users/me/src/mn/mn-samples-ietf/site/documents.xml ...
[relaton-bib] Series type is invalid: stream
[relaton-bib] Series type is invalid: intended
[relaton-bib] Series type is invalid: stream
[relaton-bib] Series type is invalid: intended
[info]: Generating html site in /Users/me/src/mn/mn-samples-ietf/site ...
[relaton-bib] Series type is invalid: stream
[relaton-bib] Series type is invalid: intended
[relaton-bib] Series type is invalid: stream
[relaton-bib] Series type is invalid: intended
@ronaldtse ronaldtse added the bug Something isn't working label Apr 13, 2021
@opoudjis
Copy link
Contributor

Cannot reproduce with xml2rfc 3.5.0. Is happening with xml2rfc 3.7.0, which means the IETF in their wisdom have broken RFC XML that used to be valid.

@opoudjis
Copy link
Contributor

opoudjis commented Apr 14, 2021

Bug in xml2rfc 3.7.0, xml2rfc/writers/html.py:

if next is not None and next.tag == 'author':
                after_next = next.getnext()
                if after_next.tag != 'author':
                    after_next = None

should read:

if next is not None and next.tag == 'author':
                after_next = next.getnext()
                if after_next is not None and after_next.tag != 'author':
                    after_next = None

@opoudjis
Copy link
Contributor

Bug already reported as https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants