Subject: [xml2rfc] xml2rfc

From: Erlend Hamnaberg <[email-masked]>
Date: Fri, 18 Nov 2011 14:08:43 +0100

Hi guys.

I've used the pandoc2rfc tool and I noticed some deficiencies in the
NEW impl of the xml2rfc.

The problem is that when you have a RFC document with ipr="none" the
compiler dies.
It does not work like the old tcl one.

<rfc ipr="none" ...>
 ....
</rfc>

I have attached a patch which fixes this. This now does exactly the
same as the old xml2rfc.

If there are any questions or comments to the patch, please reply.

Thanks

--

Erlend Hamnaberg
--- xml2rfc/writers/base.py	2011-10-25 23:10:59.000000000 +0200
+++ xml2rfc/writers/base.py.patched	2011-11-10 12:40:10.362343438 +0100
@@ -122,6 +122,22 @@
        'and may be updated, replaced, or obsoleted by other documents at any ' \
        'time.  It is inappropriate to use Internet-Drafts as reference ' \
        'material or to cite them other than as "work in progress."']
+    boilerplate['ipr']['none'] = \
+       ['This document is an Internet-Draft and is NOT offered in' \
+	'accordance with Section 10 of RFC 2026, ' \
+       'and the author does not provide the IETF with any rights ' \
+       'other than to publish as an Internet-Draft.', \
+
+       'Internet-Drafts are working documents of the Internet Engineering '\
+       'Task Force (IETF).  Note that other groups may also distribute ' \
+       'working documents as Internet-Drafts.  The list of current Internet- ' \
+       'Drafts is at http://datatracker.ietf.org/drafts/current/.', \
+
+       'Internet-Drafts are draft documents valid for a maximum of six months ' \
+       'and may be updated, replaced, or obsoleted by other documents at any ' \
+       'time.  It is inappropriate to use Internet-Drafts as reference ' \
+       'material or to cite them other than as "work in progress."']
+    
     boilerplate['ipr']['noModificationTrust200902'] = copy.copy(boilerplate['ipr']['trust200902'])
     boilerplate['ipr']['noModificationTrust200902'].append( \
         'This document may not be modified, and derivative works of it may ' \
@@ -600,13 +616,14 @@
                     self.boilerplate['expiration_text'] % self.expire_string)
 
             # Copyright
-            self.write_heading('Copyright Notice', autoAnchor='rfc.copyrightnotice')
-            date = self.r.find('front/date')
-            if date is not None:
-                year = self.r.find('front/date').attrib.get('year', '')
-                self.write_paragraph(self.boilerplate['base_copyright'] % year)
-            if self.draft:
-                self.write_paragraph(self.boilerplate['draft_copyright'])
+            if ipr != "none":
+                self.write_heading('Copyright Notice', autoAnchor='rfc.copyrightnotice')
+                date = self.r.find('front/date')
+                if date is not None:
+                    year = self.r.find('front/date').attrib.get('year', '')
+                    self.write_paragraph(self.boilerplate['base_copyright'] % year)
+                if self.draft:
+                    self.write_paragraph(self.boilerplate['draft_copyright'])
     
             # Insert the table of contents marker at this position
             toc_enabled = self.pis.get('toc', 'no')