Subject: [xml2rfc] Attribute error when converting xml to txt.

From: William Atwood <[email-masked]>
Date: Fri, 01 Nov 2013 16:39:36 -0400

I submitted an xml file to xml.resource.org, which resulted in the
following error messages (last few lines):

Resolving entity...
http://xml.resource.org/public/rfc/bibxml/reference.RFC.4302.xml
Loaded from cache reference.RFC.4302.xml

Traceback (most recent call last):
  File "/usr/local/bin/xml2rfc", line 224, in <module>
    main()
  File "/usr/local/bin/xml2rfc", line 209, in main
    pagedwriter.write(filename)
  File "/usr/local/lib/python2.7/dist-packages/xml2rfc/writers/base.py",
line 1088, in write
    self.post_rendering()
  File
"/usr/local/lib/python2.7/dist-packages/xml2rfc/writers/paginated_txt.py",
line 286, in post_rendering
    self.emit([''] * remainder)
  File
"/usr/local/lib/python2.7/dist-packages/xml2rfc/writers/paginated_txt.py",
line 164, in emit
    if self.page_length == 1 and text.strip() == '':
AttributeError: 'list' object has no attribute 'strip'

I have no idea what this might mean, or how to go about fixing it.  Can
anyone help?  The input file is available to anyone who wants it.

  Bill

-- 
Dr. J.W. Atwood, Eng.             tel:   +1 (514) 848-2424 x3046
Distinguished Professor Emeritus  fax:   +1 (514) 848-2830
Department of Computer Science
   and Software Engineering
Concordia University EV 3.185     email:[email-masked]
1455 de Maisonneuve Blvd. West    http://users.encs.concordia.ca/~bill
Montreal, Quebec Canada H3G 1M8

---

From: William Atwood <[email-masked]>
Date: Sat, 02 Nov 2013 12:40:53 -0400

Julian,

Thank you for the suggestions.

I changed (one at a time)
- trust200811 -> trust200902
- deleted workgroup entry
- resolved 5191 problem by including <xref> instead of
  hard-coding [RFC5191]

The results are identical.  Looking at the error messages, it is clear
that it is python that is objecting, so the error may be in the routine
paginated_txt.py.

By the way, the old xml2rfc generates the correct text, which solves my
problem for the moment.  I will attend the "tools" tutorial and learn
how to use "trac" to report this.

  Bill

On 02/11/2013 9:19 AM, Julian Reschke wrote:
> The XML seems ok to me.
> 
> my rfc2629.xslt says:
> 
> saxon draft-atwood-pim-sigmp-00-3.xml clean-for-DTD.xslt >
> draft-atwood-pim-sigmp-00-3.html.check
> xmlint draft-atwood-pim-sigmp-00-3.html.check
> draft-atwood-pim-sigmp-00-3.html.check
> rm -f draft-atwood-pim-sigmp-00-3.html.check
> saxon -l draft-atwood-pim-sigmp-00-3.xml rfc2629.xslt >
> draft-atwood-pim-sigmp-00-3.html
> INFO: The /rfc/front/workgroup should only be used for Working Group
> drafts (at line 25)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> 
> WARNING: unused reference 'RFC5191' (at line 3 of
> http://xml.resource.org/public
> /rfc/bibxml/reference.RFC.5191.xml)
> 
> And the old xml2rfc.tcl reports:
> xml2rfc: warning: ipr="trust200811" attribute value is outdated compared
> to Trust Legal Provisions of 2/2009 around input line 15
> 
> 
> Maybe that's what causing the hickup.
> 
> Best regards, Julian

---

From: Tony Hansen <[email-masked]>
Date: Sat, 02 Nov 2013 15:47:18 -0400

> that it is python that is objecting, so the error may be in the routine

At first I thought your problem was in your xml, but then re-read the
traceback -- it definitely looks like a python bug report.

> how to use "trac" to report this.

1) Start at xml.resource.org, click on the reference to "trac system" on
Note 3, or go directly to http://trac.tools.ietf.org/tools/xml2rfc/trac/
2) Login using your tools.ietf.org id. (If you don't have one, click on
"Get Passwd" on the left.)
3) Click on "New ticket" on the top right. Fill in the blanks and click
"Create ticket".

It helps to have a file that will demonstrate the error, so be sure to
click the box for "I have files to attach to this ticket" and attach
your input file.

    Tony Hansen