Re: [xml2rfc] Question about “tocInclude” in xml2rfc

Julian Reschke <julian.reschke@gmx.de> Thu, 04 March 2021 07:46 UTC

Return-Path: <julian.reschke@gmx.de>
X-Original-To: xml2rfc@ietfa.amsl.com
Delivered-To: xml2rfc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B25C83A1527 for <xml2rfc@ietfa.amsl.com>; Wed, 3 Mar 2021 23:46:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=gmx.net
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p2MlX5JuWJXX for <xml2rfc@ietfa.amsl.com>; Wed, 3 Mar 2021 23:46:23 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A6CCF3A1520 for <xml2rfc@ietf.org>; Wed, 3 Mar 2021 23:46:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1614843979; bh=ARyLZ0ExjC8thrmejC82KB8N3hQxliik5knCgkhufxo=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=gxyUuRGHdb8lxZJb3OdVg+Pa77OK/ThzGBeKn0TmSI0jnNFSGaNqCjevW935VVZjt m0D1UjbQ02gUbZHDE4+d04sVC/FnltdudOh5wz78O2Q0FbxsizjWtcKE3t7IP01glJ 7bo/zjnUS7YiYhmoy8wVL2DjldltZ9InZq/Z8N2k=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.178.20] ([84.171.157.160]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N17YY-1lkqQb1m4w-012bfD for <xml2rfc@ietf.org>; Thu, 04 Mar 2021 08:46:19 +0100
To: xml2rfc@ietf.org
References: <9E21EA4E-2989-46F8-A02D-344E214FC7D4@apple.com>
From: Julian Reschke <julian.reschke@gmx.de>
Message-ID: <1a322b8f-f2d5-fc9b-20f7-fdf3595481bd@gmx.de>
Date: Thu, 4 Mar 2021 08:46:18 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0
MIME-Version: 1.0
In-Reply-To: <9E21EA4E-2989-46F8-A02D-344E214FC7D4@apple.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:n89eQRqim67gd7D/gWZvbZLswdG1Z6uMNiY9h0DpLcv/Y8YTafM QM27Q3eX8oDkz61FWY2Db/k4rpNeclY91hSNigp8gLe7AgJ010+DpgVOfdjg1mb1lAogO5e fpsB4moky9sEfdXqDEIlOb6+DzjSQhcpOT4RFYDPgFblerOaZHW2efftvx2JrpBl050Q2QJ pNjeRlvH5uhdjhTjvQrow==
X-UI-Out-Filterresults: notjunk:1;V03:K0:FIdJadQ84aI=:iVy3qc/qByLb14J1aSIGUQ XIGhPRwvvGvAzHug0QNAgPW54xWDTMo+JBKXRaFoqlJXsJCTCeUd7e7owllE6z63hGaQ5Ebg4 LfnerDvM/cb8XrDO2KM5wviXrztLVwbWKPU0e9bwJjDUwuoNz5ghAANWIYdWEADOYRSDHpK3O k0vJDf1b2gvGtl/XuF9Fl5G3HNO6+40pJuTZ3CUD1uG8Dic2UFH/gVxnWIDvi955ah24jEOU9 Y3RVNkPL8/6kbqGzcY6j1H+06QDbEZ7itG8vUMMgPtndpTn9OB1VWEjgaZAEt8SrbQrJSI2bJ /j+4AtknVGlbYpqbaqUTUer4Xrk6Kg5azEgCwyG036V3hykAq0sRFE63u8mFST0KEN+J2tS/F m7m8BA5flHENzlFW3BpXGWleVHjuS7HYKhJtn6ti2Mjp0PUSfNsOiFP8oZGDJxOTo29u+S25x 38Svi6lJxva+pRVNf/fuBLHIMs83ezl4jEW8BOd/ZSWZoOjY6ySBSl/bs1it6kBDkitm1P96U BRV3ArQM2UKRcxphiD2qm1zKtboa8pAjsSJmpL7fGaYSv20YKZErhngNjMLfQKwEI7Dp5CEpj QGTwQoq0ZjyFFikKq1l2hWiXHJLZtAMFNXbOvxcUK6cQw2qB2n/qpgQaKlu/ZbPK5ZQ/0vyNv oPrdmUc12eHrfP4QCHNGsh4GVweAB4HkwJA6ZVvsBfbAP97mvle2N9NEwUQqi6b2oWl19b5QE 4CJVCanPZWsmI+E4FvlV8rwGHFgzuiaDT3353w+ZGz2GC740tj9mGow4oZk2Baapi/0B+UDsx ubQwSn4CYPo7oS8hqcuo8ATfHYHzg1EV0MlJu5Mmh7NfCzjFCq0KW6XAou7MykupZFKX5Ey99 r4yoPChDn1EzfexXRPsg==
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/0upCrJJKM27Aw4QSYlyZ1_VhTT8>
Subject: Re: [xml2rfc] =?utf-8?b?UXVlc3Rpb24gYWJvdXQg4oCcdG9jSW5jbHVkZeKAnSBp?= =?utf-8?q?n_xml2rfc?=
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <xml2rfc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/xml2rfc/>
List-Post: <mailto:xml2rfc@ietf.org>
List-Help: <mailto:xml2rfc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2021 07:46:25 -0000

Am 04.03.2021 um 06:02 schrieb Stuart Cheshire:
> I may have just found the solution myself.
>
> The error message said “object has no attribute ‘xpath’ in add_pageno_placeholders.”
>
> I added a single “if” statement so that it doesn’t try to get toc.xpath for a document that has no TOC. That seemed to fix it.
>
>    % diff -u text-orig.py text.py
>    --- text-orig.py    2021-03-03 19:58:39.000000000 -0800
>    +++ text.py         2021-03-03 20:50:34.000000000 -0800
>    @@ -369,8 +369,9 @@
>
>         def add_pageno_placeholders(self):
>             toc = self.root.find('./front/toc/section')
>    -        for e in toc.xpath('.//xref[2]'):
>    -            e.set('pageno', '0000')
>    +        if toc:
>    +            for e in toc.xpath('.//xref[2]'):
>    +                e.set('pageno', '0000')
>
>         def paginate(self, lines):
>             """
>
> Stuart Cheshire

-> <https://trac.tools.ietf.org/tools/xml2rfc/trac/newticket>

Best regards, Julian