hassanakbar4 / tractive-test

0 stars 0 forks source link

Error: Found unexpected inline element: <cref> Error: Found unexpected inline element: <cref> #389

Closed hassanakbar4 closed 2 years ago

hassanakbar4 commented 5 years ago

component_Version 2 cli resolution_fixed type_defect | by cabo@tzi.org


I don't understand the error message (and it's not an error, xml2rfc runs to completion). There is only one cref, but two identical message lines. No context given, but I expect the message lines relate to this one cref.

https://github.com/cbor-wg/CBORbis/blob/master/draft-ietf-cbor-7049bis.md

(kdrfc this to reproduce.)

Excerpt from the XML:

<t>...bla...bla...bla... are not considered part of the semantics.
  <cref anchor="_20_cabo">I don’t understand this last sentence.  Can we leave it out?</cref></t>

Issue migrated from trac:389 at 2021-10-20 18:31:22 +0500

hassanakbar4 commented 5 years ago

@{"email"=>"cabo@tzi.org", "name"=>nil, "username"=>nil} commented


Oh, found it:

raw_txt.py:

            elif element.tag == 'cref' and \
                element.pis['comments'] == 'yes':                
...
            else:
                xml2rfc.log.error("Found unexpected inline element: <%s>" % element.tag)

So the message is produced every time there is a cref that is being suppressed by the PIs.

(Clearly, the "and" should be a nested if for the new else part to stay as it is.)

hassanakbar4 commented 5 years ago

@{"email"=>"julian.reschke@gmx.de", "name"=>nil, "username"=>nil} commented


I believe the message shouldn't be produced at all, right? After all, the purpose of the PI is to hide the comments.

hassanakbar4 commented 5 years ago

@{"email"=>"cabo@tzi.org", "name"=>nil, "username"=>nil} commented


No, the message should not be produced for the cbor-wg file.

The code in the else part looks fine to me, though: It is a "cannot happen" catch-all for inline elements that made it through validation but are not handled by the code.
However, to make this else part work, the cref elif cannot be limited to comments=yes, so the latter needs to moved into a nested if.

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


Replying to hassanakbar4/tractive-test#389 (comment:3):

However, to make this else part work, the cref elif cannot be limited to comments=yes, so the latter needs to moved into a nested if.

Yes, that's right. Will fix.

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed status from new to closed

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed resolution from ` tofixed`

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


Fixed in [2856]:

Fixed a bug related to cref handling. Fixes issue #389.