Re: [netmod] Whitespace in XML encoding - allowed ?
Qin Wu <bill.wu@huawei.com> Tue, 09 October 2018 09:24 UTC
Return-Path: <bill.wu@huawei.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 244B013122B for <netmod@ietfa.amsl.com>; Tue, 9 Oct 2018 02:24:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.589
X-Spam-Level:
X-Spam-Status: No, score=-2.589 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 ZMbOlnGWm2Ev for <netmod@ietfa.amsl.com>; Tue, 9 Oct 2018 02:24:01 -0700 (PDT)
Received: from huawei.com (lhrrgout.huawei.com [185.176.76.210]) (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 D917C1311AA for <netmod@ietf.org>; Tue, 9 Oct 2018 02:24:00 -0700 (PDT)
Received: from lhreml705-cah.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id ABBC581A1C339; Tue, 9 Oct 2018 10:23:56 +0100 (IST)
Received: from NKGEML412-HUB.china.huawei.com (10.98.56.73) by lhreml705-cah.china.huawei.com (10.201.108.46) with Microsoft SMTP Server (TLS) id 14.3.399.0; Tue, 9 Oct 2018 10:23:57 +0100
Received: from NKGEML513-MBX.china.huawei.com ([169.254.1.200]) by nkgeml412-hub.china.huawei.com ([10.98.56.73]) with mapi id 14.03.0399.000; Tue, 9 Oct 2018 17:23:53 +0800
From: Qin Wu <bill.wu@huawei.com>
To: Balázs Lengyel <balazs.lengyel@ericsson.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: Whitespace in XML encoding - allowed ?
Thread-Index: AQHUX65zMY3LKhsc8UeIQzNDxdo7xaUWoQpA
Date: Tue, 09 Oct 2018 09:23:52 +0000
Message-ID: <B8F9A780D330094D99AF023C5877DABA9B05FD49@nkgeml513-mbx.china.huawei.com>
References: <14e78aaa-4508-970a-d1a0-e091ffaf5c8e@ericsson.com>
In-Reply-To: <14e78aaa-4508-970a-d1a0-e091ffaf5c8e@ericsson.com>
Accept-Language: zh-CN, en-US
Content-Language: zh-CN
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.138.33.244]
Content-Type: multipart/alternative; boundary="_000_B8F9A780D330094D99AF023C5877DABA9B05FD49nkgeml513mbxchi_"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/p0WMxQGUhFp3fNL1fY9TdMs2dss>
Subject: Re: [netmod] Whitespace in XML encoding - allowed ?
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: Tue, 09 Oct 2018 09:24:04 -0000
This issue has been touched by earlier version of draft-kwatsen-netmod-artwork-folding-07. RFC7950 has provide XML encoding rule as follows: " Any whitespace between the subelements to the list entry is insignificant, i.e., an implementation MAY insert whitespace characters between subelements. " Similar rule is applied to leaf-list. -Qin 发件人: netmod [mailto:netmod-bounces@ietf.org] 代表 Balázs Lengyel 发送时间: 2018年10月9日 17:00 收件人: netmod@ietf.org 主题: [netmod] Whitespace in XML encoding - allowed ? Hello, Recently we came up against a problem where a certain implementation did not accept the following: <with-defaults xmlns="..."> report-all </with-defaults> while it did accept <with-defaults xmlns="...">report-all</with-defaults> I am unsure whether YANG's XML encoding allows whitespace before and after a leaf's value? In RFC7950 it does not say yes or no. I have found the following examples that seem to allow preceding/following whitespace: https://tools.ietf.org/html/rfc7950#section-4.2.9 <status xmlns="http://example.com/system"<http://example.com/system>> The image example-fw-2.3 is being installed. </status> https://tools.ietf.org/html/rfc7950#section-7.16.3 <reporting-entity> /ex:interface[ex:name='Ethernet0'] </reporting-entity> https://tools.ietf.org/html/rfc6243#appendix-A.3.1 <with-defaults xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"> report-all </with-defaults> It is problematic that this is not clarified. IMHO this should be clarified in an errata to rfc7950. Chose one: 1. It is not allowed to add preceding or following whitespace after the value of a leaf/leaf-list. Note that some text documents may add whitespace to Netconf examples to avoid long lines, however this extra whitespace MUST NOT be present in the actual Netconf encoding. 2. It is not allowed to add preceding or following whitespace after the value of a leaf/leaf-list. 3. It is allowed to add preceding or following whitespace after the value of a leaf/leaf-list except for string based types, where the whitespace could be part of the leaf's value itself.. What do you think? regards Balazs -- Balazs Lengyel Ericsson Hungary Ltd. Senior Specialist Mobile: +36-70-330-7909 email: Balazs.Lengyel@ericsson.com<mailto:Balazs.Lengyel@ericsson.com>
- [netmod] Whitespace in XML encoding - allowed ? Balázs Lengyel
- Re: [netmod] Whitespace in XML encoding - allowed… Qin Wu
- Re: [netmod] Whitespace in XML encoding - allowed… Balázs Lengyel
- Re: [netmod] Whitespace in XML encoding - allowed… Martin Bjorklund
- Re: [netmod] Whitespace in XML encoding - allowed… Adrian Farrel
- Re: [netmod] Whitespace in XML encoding - allowed… Ladislav Lhotka
- Re: [netmod] Whitespace in XML encoding - allowed… Kent Watsen
- Re: [netmod] Whitespace in XML encoding - allowed… Ladislav Lhotka
- Re: [netmod] Whitespace in XML encoding - allowed… Balázs Lengyel