Subject: Re: [xml2rfc] #247 (Version 2 cli): &rfc.number; yields "XXXX" no matter what

From: "xml2rfc issue tracker" <[email-masked]>
Date: Wed, 23 Jul 2014 18:52:23 -0000

#247: &rfc.number; yields "XXXX" no matter what

Comment (by [email-masked]):

 Place a reference to one of the predefined entities, such as &nbhy;.

 Xml2rfc will generate a spurious message about "WARNING: Parsing Error:
 Entity 'nbhy' not defined, line xxx, column yyy."

 Parser.py, around line 420 has this code:

 {{{
         # Get hold of the rfc number (if any) in the rfc element, so we
 can
         # later resolve the "&rfc.number;" entity.
         try:
             for action, element in context:
                 if element.tag == "rfc":
                     self.rfc_number = element.attrib.get("number", None)
         except lxml.etree.XMLSyntaxError as e:
             xml2rfc.log.warn("Parsing Error: %s" % e)
             self.rfc_number = None
 }}}

 Then around line 111, there is this code:

 {{{
         if request == u"internal:/rfc.number":
             if self.rfc_number:
                 return self.resolve_string(self.rfc_number, context)
             return self.resolve_string("XXXX", context)
 }}}

-- 
------------------------------+----------------------------------
  Reporter:  [email-masked]  |      Owner:  [email-masked]
      Type:  defect           |     Status:  new
  Priority:  medium           |  Milestone:
 Component:  Version 2 cli    |    Version:  2.4.x
Resolution:                   |   Keywords:
------------------------------+----------------------------------

Ticket URL: <http://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/247#comment:6>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>