Re: [xml2rfc] XInclude should be used instead of PI include

Robert Sparks <rjsparks@nostrum.com> Mon, 26 June 2023 21:37 UTC

Return-Path: <rjsparks@nostrum.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 A33B2C151095 for <xml2rfc@ietfa.amsl.com>; Mon, 26 Jun 2023 14:37:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.077
X-Spam-Level:
X-Spam-Status: No, score=-7.077 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nostrum.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w5rW9KB7dAoc for <xml2rfc@ietfa.amsl.com>; Mon, 26 Jun 2023 14:37:05 -0700 (PDT)
Received: from nostrum.com (raven-v6.nostrum.com [IPv6:2001:470:d:1130::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A0745C151074 for <xml2rfc@ietf.org>; Mon, 26 Jun 2023 14:37:05 -0700 (PDT)
Received: from [192.168.1.102] ([47.186.48.51]) (authenticated bits=0) by nostrum.com (8.17.2/8.17.1) with ESMTPSA id 35QLb4kf007797 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for <xml2rfc@ietf.org>; Mon, 26 Jun 2023 16:37:05 -0500 (CDT) (envelope-from rjsparks@nostrum.com)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nostrum.com; s=default; t=1687815425; bh=QcxhnVqXv+SV34vH44gxEruidXfse4dX6pyESeLBfyU=; h=Date:To:References:From:Subject:In-Reply-To; b=r8+j9p4M/bHAMz1nFm/tNXAFNbfcKbe5P+vZpRle+zbNjcYryhkyExpRuZu4DwDhA JQhRYNUNJtaB0+lvThpwjgYIF/Uqq8vIffk4wEZRrDJF2XHStQCWcwWVdXcIGC//2I wGgCMaKt7ZRsejzlak/ZPHfZR1FtZvgmn3tXP0hU=
X-Authentication-Warning: raven.nostrum.com: Host [47.186.48.51] claimed to be [192.168.1.102]
Message-ID: <40975c07-be1c-124b-f9fa-6d8a979157b5@nostrum.com>
Date: Mon, 26 Jun 2023 16:36:58 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0
Content-Language: en-US
To: xml2rfc@ietf.org
References: <m25y7auglb.wl-randy@psg.com> <B71CAF97-2924-47FF-B28C-61E9C1B93CB1@tzi.org> <m21qhyueoj.wl-randy@psg.com> <2612E60E-6B70-44DE-A87A-5ADB7F21F923@tzi.org>
From: Robert Sparks <rjsparks@nostrum.com>
In-Reply-To: <2612E60E-6B70-44DE-A87A-5ADB7F21F923@tzi.org>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/7uxlMeGkbAk7_KoE-Z_gmV-Xpo0>
Subject: Re: [xml2rfc] XInclude should be used instead of PI include
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: XML2RFC discussion list <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: Mon, 26 Jun 2023 21:37:09 -0000

On 6/26/23 4:01 PM, Carsten Bormann wrote:

> On 26. Jun 2023, at 22:55, Randy Bush <randy@psg.com> wrote:
>> i have a local rsunk repo and am doing
>>
>>     <references title="Normative References">
>>       <?rfc include="reference.RFC.2119.xml"?>

That would look like <xi:include 
href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>

All of Carsten's observation about this hardcoding an external reference 
and that the URLs have been changing a _lot_ recently are correct, as 
you can see from the before-preptool source for one of the most recently 
published RFCs:

rjsparks@undex feat-rfc % curl --no-progress-meter 
https://www.rfc-editor.org/prerelease/rfc9425.notprepped.xml | grep 8174
     <xref target="RFC8174"/> when, and only when, they appear in all 
capitals,
<xi:include 
href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>

(The RPC is shifting to using bib.ietf.org to which xml2rfc.ietf.org 
redirects).

For Internet-Drafts, you'll need to use an href that looks like

https://bib.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-rtgwg-segment-routing-ti-lfa.xml

That is, using xi:include comes with the extra burden of knowing the 
names of the bibxml datasets.

There are conversations ongoing about how to avoid these 
author-unfriendly aspects.

RjS

>>       <?rfc include="reference.RFC.2622.xml"?>
>>       <?rfc include="reference.RFC.2725.xml"?>
>>
>> what should i be doing if i want to go to xml heaven?
> As the warning says, the canonical way is now to use XInclude.
> XInclude makes you hard-code the full URL to those reference items.
> This is great if you always want to use the information stored remotely (and if the URLs are stable, which they haven’t been for the last half decade).
>
> I don’t know much about XInclude as kramdown-rfc does all the reference handling for you (and can share a cache with xml2rfc, which you can prefill), so I don’t have to remember the details.
>
> I’m sure others will speak up…
>
> Grüße, Carsten
>
> _______________________________________________
> xml2rfc mailing list
> xml2rfc@ietf.org
> https://www.ietf.org/mailman/listinfo/xml2rfc