Re: [xml2rfc] include processing directive

Nico Williams <nico@cryptonector.com> Tue, 12 November 2013 06:53 UTC

Return-Path: <nico@cryptonector.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 4EA8811E8116 for <xml2rfc@ietfa.amsl.com>; Mon, 11 Nov 2013 22:53:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.962
X-Spam-Level:
X-Spam-Status: No, score=-1.962 tagged_above=-999 required=5 tests=[AWL=0.015, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NMh4eqo2WGYX for <xml2rfc@ietfa.amsl.com>; Mon, 11 Nov 2013 22:53:44 -0800 (PST)
Received: from homiemail-a84.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by ietfa.amsl.com (Postfix) with ESMTP id 924C621E80B0 for <xml2rfc@ietf.org>; Mon, 11 Nov 2013 22:53:35 -0800 (PST)
Received: from homiemail-a84.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a84.g.dreamhost.com (Postfix) with ESMTP id 208F41DE05D for <xml2rfc@ietf.org>; Mon, 11 Nov 2013 22:53:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=duow9VzQgOimOV2ft0Hc f9VAecM=; b=L0FCZ3qA7lU7xZgoaYOnHobLk9ZxywqfWvz18Z7iS390NlfQ6U2H iPFQYZCo9AZhUcHznX9EkRSi5/HcLOiMpjw9K8i/UrXe3beW09z6v/OCxCVtV2qE XXdk5k6+vuWzvwyIIKW6HnMUQh3y66PkGwweyVfWnMGa4R7D7h+23EA=
Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a84.g.dreamhost.com (Postfix) with ESMTPSA id C47931DE059 for <xml2rfc@ietf.org>; Mon, 11 Nov 2013 22:53:34 -0800 (PST)
Received: by mail-wi0-f181.google.com with SMTP id m19so3237457wiv.2 for <xml2rfc@ietf.org>; Mon, 11 Nov 2013 22:53:33 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RbbaLQXUIJpvTyOvEnIBlqfskYkQqZBm6+jRfwSco6s=; b=izU2gz/sqsPWfZB6Uuk1i6XdXDNCDu31kIAi4Y4y9i1C0SdGNn9O3NK2VQwMveibl3 0VHc59Wh2Qm7UVnMnPChqbGrcYcgS6UUR49d29eWHEaUIbrI6kNob175XN9y9KFtHzTC kLWV2rqEGsfUi8k9HqjY9L4JDlwsjGG95i5oi3ZUiCRYEE98F/9qDypktkhOVz1PreMw N+lix3Q6GCbIsoYq2Vq+zetu+f7x4+jpM/jnxMFrJYnt84/rip2Y2ivKxPi9GhPK44kc DWV9kDIW4uXkMQj67ikdQG61CNobj2VjwVfUBHJfnms7nFxAy9+9V3Z0mYjJ/p7c/Ajo 9XNA==
MIME-Version: 1.0
X-Received: by 10.180.184.112 with SMTP id et16mr15263289wic.4.1384239213434; Mon, 11 Nov 2013 22:53:33 -0800 (PST)
Received: by 10.216.151.136 with HTTP; Mon, 11 Nov 2013 22:53:33 -0800 (PST)
In-Reply-To: <5281CD6D.7090400@berkeley.edu>
References: <0a3701cede91$2bff9f40$83feddc0$@augustcellars.com> <5280A009.8000702@gmx.de> <CAK3OfOjs=2HiYe6rvocBPPtWO3z3AF4SVMiOutCKxfnzUFVyPA@mail.gmail.com> <5281CD6D.7090400@berkeley.edu>
Date: Tue, 12 Nov 2013 00:53:33 -0600
Message-ID: <CAK3OfOi=0oM9qj54gm8weV_4T2nA-AKdf9GE_HM=Wv+Wb6tKuw@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Erik Wilde <dret@berkeley.edu>
Content-Type: text/plain; charset="UTF-8"
Cc: Julian Reschke <julian.reschke@gmx.de>, XML2RFC Interest Group <xml2rfc@ietf.org>
Subject: Re: [xml2rfc] include processing directive
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Tue, 12 Nov 2013 06:53:48 -0000

On Tue, Nov 12, 2013 at 12:40 AM, Erik Wilde <dret@berkeley.edu> wrote:
> On 2013-11-11, 22:26 , Nico Williams wrote:
>> Agreed.  One use case I've seen a few times is where you have a large
>> ASN.1/XDR/whatever module that needs to go in an appendix but select
>> pieces of which need to be interspersed with the prose for explanatory
>> purposes.  [...]
>
> not really. unless you plan on making <artwork> itself inclusion-enabled
> (which i think would not be such a great way to go), you simply use XInclude
> and you're done. this is a working snippet from
> https://github.com/dret/I-D/blob/master/xml-patch/draft-wilde-xml-patch-08.xml,
> which requires XInclude processing (&files; is defined as
> "draft-wilde-xml-patch-08-files" in the XML):
>
> <artwork type="xml"><xi:include parse="text"
> href="&files;/patch-document.xml"/></artwork>

I guess I could live with that.  I'd rather have something somewhat
better integrated, but I suppose we've been hacking our way around
this so far reasonably well -- why stop?

> the current downside of XIPr (the XInclude processor i am using,
> https://github.com/dret/XIPr) is that you can only include complete text
> files, and not fragments. XInclude 1.1 fixes that, but i haven't implemented
> it yet. i have no idea how widely 1.1 is supported, but i would guess that
> most current XInclude implementations are 1.0 only. 1.1 support would allow
> something like this:
>
> <artwork type="xml"><xi:include parse="text"
> href="&files;/patch-document.xml#line=10,12"/></artwork>
>
> one problem is that if you support 1.1 (i.e., fragments for textual
> inclusion), once you insert one line at the start of your included file, you
> have to adjust all fragment identifiers or they'll "get out of sync"
> (integrity checks http://tools.ietf.org/html/rfc5147#section-3.1 can be used
> to detect this situation, but they won't fix it). there's no easy way around
> this. but apart from that, it's certainly much better than what i was doing
> before, i.e. copy/pasting files into the XML source.

Yeah.  No, that's awful.  I want fragment IDs.  In general all these
code modules are written in languages that permit comments, so the
obvious thing to do is to put the whole module in one file (well,
where it makes sense) and then mark it up with comment directives, and
extract fragments to Xinclude (or whatever) into the prose.  That
kinda means hacking it up every time, or at least once per-language.

Nico
--