Re: [netmod] Use XML namespaces in YANG document examples

tom petch <ietfc@btconnect.com> Thu, 03 February 2022 11:53 UTC

Return-Path: <ietfc@btconnect.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 832453A138A; Thu, 3 Feb 2022 03:53:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_BLOCKED=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=btconnect.onmicrosoft.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 Xis0YekBnF9K; Thu, 3 Feb 2022 03:53:30 -0800 (PST)
Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0718.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::718]) (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 E69AF3A1384; Thu, 3 Feb 2022 03:53:29 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EZX05f0iY77Ed/xQfFPvaEksnY4t93OV3TA5o84zCTxjs2NajESa1/tGjToIez6/YwSOca7gHguao0DUePUZ6yZ7dXyDpDPxyiaaJ1hw6KDviOanXFroFVS1fP+fvu4Nit1NY2VUuX+ZMfc+rcKoVcY5F2gEeUCXm3WSOfGSlW/rTW98yIMElBWnJ0nECIgpZepdyT3z7WLHD43/PW8Ve8quUX0jdgFZTegfD7qP3M3340Y9oV9a7iEr8vgQQXTSWd1bS/LcOgOyvqnPnhlU0A95MJUfd6fYQSnPtSaFx2557wnrT0dphP4OyFZ3dNxlK7ZuDZpXCpbDZvb0a+/P3g==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vpvmni1aXnJqG7uA/BA4Ro4MyOYLmgms5bvaIO26BUs=; b=ZxcxhUdjOpVDSQHlm6Lgypda+wHjpB88Na1XvcxE3qzfGAcaFjvsaj1jsaIkylPP2nS9QuZZEm0ZMwLqcAPg1j8FElb7q3P7cL9GYtqIeu0f/oUw9SzW+WMeCHlXsrmW2kHXRcFHOju3wwMsKD00LmBNZQRjd2kUc5gro6bvx/lMyitX5i5zqoVvF4M+KfSzEdrtqLrRSYfoBaIzf23eVLoz11mgbevNVkXEImJo8hPLutYYXMjc8Ha5k1S8GUjIpLuJA9zNCqKln+aITTOxtIrpOu447MOupD3deOqjNxnoLaWQVkk05io1RCmB0fVhdlRptK0jGJ/x6sJmKvLCiQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btconnect.onmicrosoft.com; s=selector2-btconnect-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vpvmni1aXnJqG7uA/BA4Ro4MyOYLmgms5bvaIO26BUs=; b=VT1PlAKZsMmW0SKRddPiHMhxgQRb69VEF4QEb3ysZHKaP6gkMhpeaeofCOn6PFOXssXOeF4jaSEi5V6JmZkG2UUYPt7AS3nyj9N1JfRBYQ7e2vzfh+4PupXwY8S847gE5OXuzug43aikNabCk8zsBxv3h7Ni+DKzF3EJJ16b1bY=
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com (2603:10a6:20b:134::11) by AM9PR07MB7059.eurprd07.prod.outlook.com (2603:10a6:20b:2ca::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.10; Thu, 3 Feb 2022 11:53:25 +0000
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::719a:2b70:b9fd:d912]) by AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::719a:2b70:b9fd:d912%7]) with mapi id 15.20.4951.012; Thu, 3 Feb 2022 11:53:24 +0000
From: tom petch <ietfc@btconnect.com>
To: "ianfarrer@gmx.com" <ianfarrer@gmx.com>, "netmod@ietf.org" <netmod@ietf.org>
CC: "dhc-chairs@ietf.org" <dhc-chairs@ietf.org>, "Eric Vyncke (evyncke)" <evyncke@cisco.com>, Tim Bray <tbray@textuality.com>, "drafts-expert-review@iana.org" <drafts-expert-review@iana.org>
Thread-Topic: [netmod] Use XML namespaces in YANG document examples
Thread-Index: AQHYGOG6tWVJ4yLJbkequbdkAxANeayBtsHt
Date: Thu, 03 Feb 2022 11:53:24 +0000
Message-ID: <AM7PR07MB624865498F51F41EFD26D723A0289@AM7PR07MB6248.eurprd07.prod.outlook.com>
References: <B6F5C201-A42B-47AB-9518-886C97EBA931@gmx.com>
In-Reply-To: <B6F5C201-A42B-47AB-9518-886C97EBA931@gmx.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
suggested_attachment_session_id: 86e1d166-80e7-8ccd-121c-7d646120e063
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=btconnect.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: b887ce83-9e4e-41e0-296f-08d9e70bc8d6
x-ms-traffictypediagnostic: AM9PR07MB7059:EE_
x-microsoft-antispam-prvs: <AM9PR07MB7059D467FC048BE2C42D042BA0289@AM9PR07MB7059.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: gjn29gLoimFARh7r6cBspz5IhA/CCp3IyG8UAMZWcyByr2rbD/QDVzmquwub7MdkLyARUeg1iX5VpF1FroteLwuoSLMhZtq75UMQp7+CDGmhPZrxPmjKLE0CnrYF5oJgeMXK9RAbc6qw0lt4hvL6pVSlW3QFZe0UDtCZUhd2ystSKc+patZnwFU/2PJCDvO5TmhwSmQglfhw3sZPtwHIvugcBtnyUY4jLWp2md9pWXs/HStyHiK9QrFz7L94ibdYJphY2p//9KfjBqGFIL+ZVO1qcC2flpdUxcILkxk8Ewsy1hOqYEWrgg4Rr1HXSuygNkKel3X2f7SL6fZTf8m6FVkyfs9l38DK0n1JnLtbFpYLGBGl5YuAax8410gtRQuawENZi9ypeb2JRH5dGLpwJqUwo3PVi2r98LuUJ//5MondZaQ6z9Onzv9TAqddpEsBCh0+tmK5KFfEV3yKGALrbhLvvk9ldWXnEUBUcsi0sIZS2oiZeJyzVQwCuRoYdVb3Njq1nVR1RdEru/pS9IrP1zWNmSL8MR6T+QGJ1f3KCu/dS/DpDf+9lazFfLP1Xe6s5iM+VtaStt4ieMBL8qZd3+Mbuxauf/BW9cDeN5H9DO5ECMu6Lb6WgutvwERed3S2u5XT5WQKmD8KnkblmRXaPu1qrNhNeST8pQYyWDV1tNtLBDKnYaye7x8Ejy4tYFzqYLMfK8tHAkESiJWqH1t12J0LENW6McaeDs6XarAZhgh0ejWr7B5NbT0fgEKPPMiNaoNYrWv79fcvHmALjvMXzS4s3kRWQGFIF7WeEoJJzed2ZGDzD/VHzz15Kbb7aimT
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR07MB6248.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(83380400001)(66446008)(6506007)(55016003)(66556008)(8676002)(4326008)(76116006)(66946007)(64756008)(66476007)(54906003)(186003)(2906002)(91956017)(33656002)(38100700002)(26005)(122000001)(8936002)(38070700005)(508600001)(9686003)(316002)(86362001)(52536014)(7696005)(71200400001)(110136005)(82960400001)(66574015)(5660300002)(518174003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: ThO1t3BKRLeCk/+u9/L6FSgdO9/2I1AXsR6l0YK4lo5y1QarXssquzDMKgYAzyXiMcpE6MP1Gjei8QQvIsccpx1XttZhH/ow8foEc/sYKn3QMTkYTTlzH/qo45PZLl7StnA6JXXZUQxS8RPq9XoHUm4BJxCG++yvsDWFbgOisy/RR+QPei5trvdDRoR1Q/iDSkb25TXpI2CvTnlyEs6ejlI0dCJUXZcoaTcbGzfbHc+e6GJG1jByU39D5oz1mLR9i/D87P+Bo6DbJi9h6wvNlWyjK62vexHsutDzJTmyWP0niangPsxeXKiafIC0yr0RyEJmgYns2Ri5vFqjdTuqlwU+QOJiTs3AX5TaKfGXfldbOG2jL49ehnA5TpY5N7oAU5OsABkhLqoPVoNYM83Z6QeAe5sf8xUSgCC9l205N+9Bq0Jmfxbqs1LRo4+0W2sIujv4w+B1cRyBBclfnt+2qgabFgHPuQrDOLX3cugoXR1A7JkpwW8yeJnptA0IPhVChg0KY3Zt3tdiE48EMaPFLU6yXvpBjOSFmsKL29WnHidEFDP/5kxNWhK1N7bbn91r7M6QHrrdb6gG0WTqDpue6BGmIqfhV51OgaqO8uivd57SWTBV9Umczr0/3h+7rBqkEYB6p3hidLunL4kmcnRvSLupfBJxWCkFvlfpY1Fd95T19EYVcSa8UvE82nShqnpE0ngTXBxBb+1jd5z6bsHje3YsJRhva6PjV2J1QTpouN/dMoc0jj7Ccr3ihn6hTls1R/WRmB6kSmJUoKqI6M7Xhsc0hrinFscrZ1nDPq7nohvKOlQyRMaHFYkhpDTxavkpugdcdhVqbV/WaTi0GA90qvyoc6JbFerokubxpT6F6bZmOcVeEZaAhw65qiTTv0bJ+w65y2N+rGsfq516CqpK65LO9U8XRSUsymXqCCaqMs3qIpMSFPPt73LSmS81vLgNa3hn+rmWXReGPa4C7WziadAYnmakc7MeGoSFwx15YBZ707LmBw2waSQL49Ukzr5rzJzbBw72eERJQqVef4qVNrg3wR8BaGBUTi5wk2xCsDeSWhtGx7bOXNJ8cxdzJgnlMSyBPcm0oMG7Cw0TYp0kgMlmXQMgrKiAncyvTj892IIfUdMITjz5Qe57DzkAJpZGvWF6fcmQrugpD9TbKC1s9Edjlx9okkekVo3ivqflyzOLZbvkWvnUrnEX+DOwDZwINnf3AfHKkx8EDja8nQMGMAAhA22D4wFKF7KICTzN9PJsXSCsrccGIOIVh7sQFUP6bm753S/UmdiHfUmGX4FVKdQBuMZriENNQCgo5JLwxkDIN2N6r+dp8Oo/oZXoyJ8uUcKwdbZqfuFoEazS3s7w2YLaX0bksR9EeAqxw8aiqJUEcqiP6XI2o+sRBVpVWcN0vtp/oxSoXiFpz6Z71jUEU3Ijk8CvkWaRPRXmLUCRYnX5AQiBms5aSix2rP9BzjA0EDgqHTWyk6SoFdr3qETbLGfJCjrDbuq4DfXUzZirXLgtoMZUXiCkZg1+kDbN2a1thTqae9CASMLM5iS0SktWjoY/3i/07XFuSW3LZ0JS/DQGXa46HjfhyxU06L978DYbYOTqp6Svj6tvtJzc5CWXvQ==
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: btconnect.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6248.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b887ce83-9e4e-41e0-296f-08d9e70bc8d6
X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2022 11:53:24.8050 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: cf8853ed-96e5-465b-9185-806bfe185e30
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: v8W++WTuEVutiYYypuWSXZ0x+NPPb63Ps+pDcdVbliREZ4XVp0Vxo7kCOQpH2/OJrQExL9HKo39sCVAcIce3UQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR07MB7059
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/uRuX3CXfOquhIxDWF_c1zLDL4bA>
Subject: Re: [netmod] Use XML namespaces in YANG document examples
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 03 Feb 2022 11:53:35 -0000

From: netmod <netmod-bounces@ietf.org> on behalf of ianfarrer@gmx.com <ianfarrer@gmx.com>
Sent: 03 February 2022 09:37

Hi,

A draft I have been working on (https://datatracker.ietf.org/doc/draft-ietf-dhc-dhcpv6-yang/) contains a number of XML configuration examples. During the XML expert review, a question has been raised about the use of XML namespaces in these examples. I’m raising it here as I don’t have the XML knowledge to answer.

<tp>

Ian

This looks like the issue I raised on this list 14jan2022 with a subject line of 
XML and prefix
although I have not checked that the usage is exactly the same; the 'XML Expert' comment would appear to be.

Tom Petch

In my example:

<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"

     xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
     <interface>
       <name>eth0</name>
       <type>ianaift:ethernetCsmacd</type>
       <description>DHCPv6 Relay Interface</description>
       <enabled>true</enabled>
     </interface>
   </interfaces>

The question is related to the use of the ‘ianaift:’ prefix. This is quite commonly use in XML examples in YANG documents (e.g. RFC8344) so I think the question is generally applicable.

The specific comments from the expert review are:

-
For the correct processing of these documents requires that whatever XML software is being used makes available to application code the namespace prefixes.

Whilst the recommended tools (e.g. yanglint) provides this function, it is not an XML best practice. Quoting from the Namespaces in XML, section 4: "Note that the prefix functions only as a placeholder for a namespace name. Applications SHOULD use the namespace name, not the prefix, in constructing names whose scope extends beyond the containing document.”

I think that violating a SHOULD assertion in a W3C standard is a problem.

There is no requirement for XML processors to provide this prefix information, and software that (quite legally) doesn't, will not work correctly with YANG documents constructed as specified in this I-D.

1, YANG specifications should note this fact and specify that software which is used to process YANG documents MUST provide an interface such that applications can retrieve the prefix-namespace mappings.
2, For constructs such as <type>ianaift:ethernetCsmacd</type> the Internet-Draft should specify that the prefix ("ianaift" in this case) MUST be identical to the xmlns namespace prefix representing the namespace name urn:ietf:params:xml:ns:yang:iana-if-type
3, Alternately, the draft could specify that for the namespace urn:ietf:params:xml:ns:yang:iana-if-type, the XML namespace prefix ianaift MUST be used. Another XML bad practice because software that generates XML programmatically should feel free to generate synthetic prefixes without breaking the content, but at least this would solve the problem.
-

BCP216 (RFC8407 - Guidelines for Authors and Reviewers of Documents Containing YANG modules) doesn’t make any mention of how XML namespaces should be used, only that example XML/ JSON should be included and that these examples need to be validated (pyang and yanglint are mentioned for this).

Does this guidance need to be updated to reflect expert review comments above?

Thanks,
Ian