Re: [xml2rfc] [xml2rfc-dev] [rfc-i] Script to generate RFC reference including abstract?

Ronald Tse <tse@ribose.com> Sun, 24 January 2021 23:43 UTC

Return-Path: <tse@ribose.com>
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 14C283A040B; Sun, 24 Jan 2021 15:43:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.2
X-Spam-Level:
X-Spam-Status: No, score=-0.2 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-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=ribose.com
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 7YB3W1uZlyuf; Sun, 24 Jan 2021 15:43:37 -0800 (PST)
Received: from APC01-HK2-obe.outbound.protection.outlook.com (mail-eopbgr1300045.outbound.protection.outlook.com [40.107.130.45]) (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 AA06E3A03FA; Sun, 24 Jan 2021 15:43:36 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AzBk+8b2QWbPgEg1Ugy7h7vmrwYOgL83cZjRoA9iNOYCkyYRvsZrQIVN5CL4C61PCGHp0frGJDzDCUTW3kKr0P/I2BPWfW4u/ys8GqWXNP18cJJZXuEEJfu1jV7rmQo19wvC+SpdSLDmCFlov7biXyLiZCNmuPRjKvu7pdLP7ZANiNyFy6rG8hUBJXPS+GJtz0Ry8I3BDZpattqS8uxR30nrgprcCVu9ooJRuq8TivaLDf4Dn7KceX3STDhBZ31+wIENNefyReqqdrwqWIm8oHaGPIekAkXRQSMPrGNPCwTzn6R5JzRuTRu0Loa17StgBPuudnrEYsIArXYgXhzfSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XJ1AU+Z7ncOI7cGNhxyMN+CNEUtngFVJf/0bKu54VQ4=; b=MfFl09JN91ZijPpqKc8kdJ5g0Va7Eukf8g9iaBRKaIdtnSIdom1TuJusHCXuB1x3K+kuAJIGMj7oilBzaIHvptOQjUdZaFb3Flqv9gHi4U0PfuqEUQ8QTzuI//6bl1rpvfxjhnRDPIwq0bOn70RbN6ZzGnfiFVoOwQQyQUPp2ZwuA7pF9RZNwaxiofaR/L81bRHHNb9ql6K70/EA5DX8yDSRlywX9E9frkFL2yt6z912gajq+XWLW0+STyMfvP/qiuuFKJqDzmnHdN2rf5tYkcfMpCZj+dhX89nrhkOQUfBmeXvgKdwibHMdFBwnZa8/PzEE+Ea5HEEe6xWqDt8PIg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ribose.com; dmarc=pass action=none header.from=ribose.com; dkim=pass header.d=ribose.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ribose.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XJ1AU+Z7ncOI7cGNhxyMN+CNEUtngFVJf/0bKu54VQ4=; b=DHyPSUL0cAAEsjQknBPLs2MXQA1zsE31dcQOhHK2ygaVqNQZaA3ljDeu9HyYJnkce9FPVaz8/MEx0wNM7k0dwkoexAenFnFIlBSLlmeBkIektkwoqvLp0mmNkSA/3xh1kW8JX8k+r7zDwipdTJn5ICtqdm1rncBq9Yn9D5ME96w=
Received: from HK0PR01MB2900.apcprd01.prod.exchangelabs.com (2603:1096:203:98::14) by HK2PR01MB3233.apcprd01.prod.exchangelabs.com (2603:1096:202:25::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.15; Sun, 24 Jan 2021 23:43:25 +0000
Received: from HK0PR01MB2900.apcprd01.prod.exchangelabs.com ([fe80::3109:413c:b2ec:d0d4]) by HK0PR01MB2900.apcprd01.prod.exchangelabs.com ([fe80::3109:413c:b2ec:d0d4%2]) with mapi id 15.20.3784.017; Sun, 24 Jan 2021 23:43:25 +0000
From: Ronald Tse <tse@ribose.com>
To: "Andrew G. Malis" <agmalis@gmail.com>, RFC Interest <rfc-interest@rfc-editor.org>
CC: XML Developer List <xml2rfc-dev@ietf.org>, "xml2rfc@ietf.org" <xml2rfc@ietf.org>
Thread-Topic: [xml2rfc-dev] [rfc-i] Script to generate RFC reference including abstract?
Thread-Index: AQHW8nLvcjsrcFLZ+UexNOnO14/QHKo3JzOAgAAmkACAACK8gA==
Date: Sun, 24 Jan 2021 23:43:24 +0000
Message-ID: <F97B1BA2-4E81-4383-83F6-552A2072CF56@ribose.com>
References: <CAA=duU2nj0G2H9v3Fft5iBAA8bxTX0zNgZsevMpojZY3TZQ6dg@mail.gmail.com> <CANeU+ZC7jZmHUTK==WghKb6W-eFZ9eHhH7UNHN9kSxNZR9N7gw@mail.gmail.com> <CAA=duU20AivvTbGQFpAZ09n=wnv-sicJj5Xt0Xamuck_kAJa9A@mail.gmail.com>
In-Reply-To: <CAA=duU20AivvTbGQFpAZ09n=wnv-sicJj5Xt0Xamuck_kAJa9A@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3654.40.0.2.32)
authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=ribose.com;
x-originating-ip: [58.153.245.161]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: c667a660-7e94-458e-c1a3-08d8c0c1d7ae
x-ms-traffictypediagnostic: HK2PR01MB3233:
x-microsoft-antispam-prvs: <HK2PR01MB32337B81B703461966857B2ED7BE0@HK2PR01MB3233.apcprd01.prod.exchangelabs.com>
x-ms-oob-tlc-oobclassifiers: OLM:8882;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: fcAPK5JBKC5k9nzWeZCjz7CNgpZVQdse4gVdr9hfhMqBtvvjcRdG7RHg1h5doleJ51FgBUpkL6iBdJmlpH7GTQ5WSXx2rRfaxRCH0Zza6FAr6bnBOoJjxmbzRsKUK0hra0GFLAay46dNk3Cgvb8Q1kQKs18ItVWcFPNAn6Z1NnWZgflfWUejBlMePC6piFqb6FQoHkQ9UG7GrpFgET9nftbXboKwdLM7qk2Cw1hCYb5o2ZdJ+lW9k07SZ3J7z9ugMbrDKW7I6ljUCtl6CdOf6wCriFoZxsS9tZQeiSfIc/Uf8XyWZROGdm6agnylF961cOWgi68ykZl7y7pvUFHK/ikRanutP6o+9cq9CLS01xi0KlBOCgihedIHjkbZQtEgiuH6tPyLtwUa2g3p43tqmQaioVWO/iXlrygqqoV9fddyZlUFxI+B4Pquz4paSLyTBsRM6kcuBJIQqVv2wdD2ng==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HK0PR01MB2900.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(346002)(376002)(39840400004)(396003)(366004)(136003)(36756003)(26005)(66574015)(6486002)(15188155005)(16799955002)(71200400001)(966005)(8676002)(6506007)(186003)(53546011)(6512007)(8936002)(166002)(86362001)(2906002)(4326008)(91956017)(76116006)(2616005)(5660300002)(110136005)(54906003)(66446008)(478600001)(316002)(64756008)(66476007)(66946007)(66556008)(33656002); DIR:OUT; SFP:1101;
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: multipart/alternative; boundary="_000_F97B1BA24E81438383F6552A2072CF56ribosecom_"
MIME-Version: 1.0
X-OriginatorOrg: ribose.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: HK0PR01MB2900.apcprd01.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c667a660-7e94-458e-c1a3-08d8c0c1d7ae
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2021 23:43:24.9792 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: d98a04ff-ef98-489b-b33c-13c23a2e091a
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: L+oEDgBJR9fUme+jWggWJLzaF2gIQc1O6UwM6Exg4rTk+fvj1SMiMC6ix6i+BWB/
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR01MB3233
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/Ta3TIQkHt7FTLnJf1VjeWWyJBzU>
Subject: Re: [xml2rfc] [xml2rfc-dev] [rfc-i] Script to generate RFC reference including abstract?
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: Sun, 24 Jan 2021 23:43:39 -0000

Hi Andy,

Relaton’s CLI (https://github.com/relaton/relaton-cli/) supports something like this:

——
$ gem install relaton-cli
$ relaton fetch --type=IETF "RFC 8660"
——

STDOUT:
——
<bibitem id="RFC8660" type="standard">
  <fetched>2021-01-25</fetched>
  <title format="text/plain" language="en" script="Latn">Segment Routing with the MPLS Data Plane</title>
  <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8660.xml</uri>
  <uri type="src">https://www.rfc-editor.org/info/rfc8660</uri>
  <docidentifier type="IETF">RFC 8660</docidentifier>
  <docidentifier type="rfc-anchor">RFC8660</docidentifier>
  <docidentifier type="DOI">10.17487/RFC8660</docidentifier>
…
  <contributor>
    <role type="editor"/>
    <person>
      <name>
        <completename language="en">A. Bashandy</completename>
      </name>
      <affiliation>
        <organization>
          <name>Internet Engineering Task Force</name>
          <abbreviation>IETF</abbreviation>
        </organization>
      </affiliation>
    </person>
  </contributor>
...
  <language>en</language>
  <script>Latn</script>
  <abstract format="text/plain" language="en" script="Latn">Segment Routing (SR) leverages the source-routing paradigm.  A node steers a packet through a controlled set of instructions, called segments, by prepending the packet with an SR header.  In the MPLS data plane, the SR header is instantiated through a label stack. This document specifies the forwarding behavior to allow instantiating SR over the MPLS data plane (SR-MPLS).</abstract>
  <series type="main">
    <title format="text/plain" language="en" script="Latn">RFC</title>
    <number>8660</number>
  </series>
  <place>Fremont, CA</place>
</bibitem>
——

The output is Relaton XML, which you could re-format into the format desired using XPath utilities like xmllint or xmlstarlet.

e.g.
——
$ relaton fetch --type=IETF "RFC 8660"> foo.xml 2>/dev/null
$ xmllint --xpath '/bibitem/abstract/text()' foo.xml
Segment Routing (SR) leverages the source-routing paradigm.  …
——

You could also output the bibtex format:
——
$ relaton fetch --type=IETF --format=bibtex "RFC 8660"> foo.bib 2>/dev/null
$ cat foo.bib
@misc{RFC8660,
  author = {Previdi, S. and Decraene, B. and Litkowski, S. and Shakir, R.},
  publisher = {Internet Engineering Task Force},
  address = {Fremont, CA},
  year = {2019},
  month = dec,
  timestamp = {2021-01-25},
  url = {https://www.rfc-editor.org/info/rfc8660},
  month_numeric = {12}
}
——

Hope this helps!

Ron

P.S. Relaton CLI supports references to most SDOs including ISO, IEC, etc using a unified bibliographic metadata model.

_____________________________________

Ronald Tse
Ribose Inc.

On Jan 25, 2021, at 5:39 AM, Andrew G. Malis <agmalis@gmail.com<mailto:agmalis@gmail.com>> wrote:

Mike,

Thanks, not quite what I was looking for, but it might be useful as a basis for scripting.

Cheers,
Andy


On Sun, Jan 24, 2021 at 2:21 PM StJohns, Michael <msj@nthpermutation.com<mailto:msj@nthpermutation.com>> wrote:
Maybe try this?
http://web-harvest.sourceforge.net/manual.php



On Sun, Jan 24, 2021 at 12:04 Andrew G. Malis <agmalis@gmail.com<mailto:agmalis@gmail.com>> wrote:
Just to save myself a bit of work if this already exists ....

Have any of you written a script when, given a list of RFC numbers, will generate an xml2rfc-ish reference and pull out the abstract for each RFC? Something like, when given "8660", will produce:

   [RFC8660]  Bashandy, A., Ed., Filsfils, C., Ed., Previdi, S.,
              Decraene, B., Litkowski, S., and R. Shakir, "Segment
              Routing with the MPLS Data Plane", RFC 8660,
              DOI 10.17487/RFC8660, December 2019,
              <https://www.rfc-editor.org/info/rfc8660>.

   Segment Routing (SR) leverages the source-routing paradigm.  A node
   steers a packet through a controlled set of instructions, called
   segments, by prepending the packet with an SR header.  In the MPLS
   data plane, the SR header is instantiated through a label stack.
   This document specifies the forwarding behavior to allow
   instantiating SR over the MPLS data plane (SR-MPLS).

Thanks,
Andy

_______________________________________________
rfc-interest mailing list
rfc-interest@rfc-editor.org<mailto:rfc-interest@rfc-editor.org>
https://www.rfc-editor.org/mailman/listinfo/rfc-interest
_______________________________________________
xml2rfc-dev mailing list
xml2rfc-dev@ietf.org<mailto:xml2rfc-dev@ietf.org>
https://www.ietf.org/mailman/listinfo/xml2rfc-dev