Re: [netmod] Whitespace in XML encoding - allowed ?

Balázs Lengyel <balazs.lengyel@ericsson.com> Fri, 12 October 2018 14:13 UTC

Return-Path: <balazs.lengyel@ericsson.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 62397130E2E for <netmod@ietfa.amsl.com>; Fri, 12 Oct 2018 07:13:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.054
X-Spam-Level:
X-Spam-Status: No, score=-3.054 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.456, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FROM_EXCESS_BASE64=0.979, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com header.b=RypX1xUC; dkim=pass (1024-bit key) header.d=ericsson.com header.b=jnedFzSC
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 jWpEkRa3vWx7 for <netmod@ietfa.amsl.com>; Fri, 12 Oct 2018 07:13:51 -0700 (PDT)
Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.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 E6DA2130E1F for <netmod@ietf.org>; Fri, 12 Oct 2018 07:13:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1539353629; x=1541945629; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=f/5KGsyJkDqUF0ONEkXCtaZ701IM6j5gRy8/VGiDq40=; b=RypX1xUCIYUDKOkxfoMK6Xc5n2aHwWy+GKqgO5/V8KYEdgcCBjeOKfbXJGxOTLmB dC4Qx7nLOUQJAXNrhoQjzHhNsQx55S7zj29XlvyPLDJfqBNb5H6LfmzT/vnZnZAW bXsOAjT1Diy1L//73VrVxnSyB7/fcBC7YN+Vy/vmLOM=;
X-AuditID: c1b4fb2d-b4fff70000003a27-c9-5bc0ac1d39df
Received: from ESESSMB502.ericsson.se (Unknown_Domain [153.88.183.120]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id A0.AF.14887.D1CA0CB5; Fri, 12 Oct 2018 16:13:49 +0200 (CEST)
Received: from ESESBMB502.ericsson.se (153.88.183.169) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 12 Oct 2018 16:13:48 +0200
Received: from EUR04-DB3-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB502.ericsson.se (153.88.183.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Fri, 12 Oct 2018 16:13:48 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EFercualyMUbGeuk2L7rFyDl+eCpJrZgeu1OM5/04y4=; b=jnedFzSCfmbPmJ8paQPrkFTtd7iX0vuUm2Ba4fGe3J/PGyeK81AiwRs9EhM+sWfPoHrXracSRVibQmjT0avbgtJzVpMVAx9qXJL9PRi76yT2Meh8LVBAdEqLCdbFhndLIyS3T7w82mQ1Nenal94YT44M5gUBTu0Tceenzw2TC5w=
Received: from VI1PR0701MB2736.eurprd07.prod.outlook.com (10.173.80.148) by VI1PR0701MB2127.eurprd07.prod.outlook.com (10.169.137.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.12; Fri, 12 Oct 2018 14:13:47 +0000
Received: from VI1PR0701MB2736.eurprd07.prod.outlook.com ([fe80::4e4:6761:27d5:5bd]) by VI1PR0701MB2736.eurprd07.prod.outlook.com ([fe80::4e4:6761:27d5:5bd%10]) with mapi id 15.20.1228.020; Fri, 12 Oct 2018 14:13:47 +0000
From: Balázs Lengyel <balazs.lengyel@ericsson.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] Whitespace in XML encoding - allowed ?
Thread-Index: AQHUX65zMY3LKhsc8UeIQzNDxdo7xaUbrDIA
Date: Fri, 12 Oct 2018 14:13:47 +0000
Message-ID: <4bd29364-2e4c-8087-7d59-998ceeb525b3@ericsson.com>
References: <14e78aaa-4508-970a-d1a0-e091ffaf5c8e@ericsson.com>
In-Reply-To: <14e78aaa-4508-970a-d1a0-e091ffaf5c8e@ericsson.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [89.135.192.225]
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1
x-clientproxiedby: HE1PR0902CA0008.eurprd09.prod.outlook.com (2603:10a6:3:e5::18) To VI1PR0701MB2736.eurprd07.prod.outlook.com (2603:10a6:801:8::20)
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; VI1PR0701MB2127; 6:p/xsqsFJGNVKilgUUfr/Bk12I0wW3jl8MFoIPB4cPRArxjtm8ZRpmNibS5tdAecZoDNreDH6048JtM+B/HnL1mue1kYvrMbX0dhAJZm3K4bj9ZhaqZLXceDUQjInAJPJbR7AfsC8OTgFENY5UIrrJ81rJcJe9AOJY6OTARcrLdDdhiY6ZUZu1lhPvtvih7owjzn1URClr63duwC9Iz6eaw5LFM33E2fgQgMp8dy+AP57cViArGMrZcDZBsEm4aqj8MioJkc/8/SCsnQ6kQhaF6naYS2l9tNsh0lQlSqyQe2S4YYiMhRdvgb4aGt6FRv5LkElljDNC4Mp9ApD2k4YVUNyPbx4sIYulBQPlDyrKJnFp/OajTh9uUwOjhf2lxqXDH+miycu3JVRb/7NeZmn9FF3g2qwWWkb0mn14vAkm0vDVVi3ccGz6W1Few02tyuWxfUoX4f7EbMHi8Y0CjMw3Q==; 5:G7Lh40T4PytIa2Sjz4I3MvrrBpD1lUdl3IbPSayFX7Bv21pJsmhAf3bcsX9Iti5HRBS7U9rbYaEoEEcEtBev+1Lk/wZ94fkveLmN4GyWq//VAMU7FSGmlP/4WdVOKs5n1mWgK/oaW5C1AGKBKnEt4wxtmkGP/8niHQVdtgQZ0LE=; 7:bfbbpEn9D5ipoYxwVT2vvx6ePJXqjDy8wcxf2FGXJ7c+WPo+1bWPlmPpcDAFCMXXZpkf+rNfTGsrdvyWYPtGWoomO7LSiDU+/tte4NRPr+0k7LCinZgWXPNYdlbQezSoLapDspQlWMOQSLZZK3XUTLPFxbaflX/5z+5RlVQTMpvEuaQ04vAWsuE4YpMSa/w0juF9ubyD4cUtwN7S17nSlPlFDEaSCbewEgOb4BR7XzPCHYKXw41f3qbr4iQLLZVJ
x-ms-office365-filtering-correlation-id: 9e855568-7da9-4ac4-a67b-08d6304cebd8
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(49563074)(7193020); SRVR:VI1PR0701MB2127;
x-ms-traffictypediagnostic: VI1PR0701MB2127:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=balazs.lengyel@ericsson.com;
x-microsoft-antispam-prvs: <VI1PR0701MB2127A2D1EAED46F8A11DD7D4F0E20@VI1PR0701MB2127.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(37575265505322)(248295561703944);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(102415395)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(4983020)(4982022)(52105095)(149066)(150057)(6041310)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991067); SRVR:VI1PR0701MB2127; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0701MB2127;
x-forefront-prvs: 0823A5777B
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(252514010)(14454004)(53376002)(68736007)(6246003)(31686004)(3260700006)(25786009)(606006)(86362001)(36756003)(66066001)(6916009)(478600001)(65956001)(65806001)(966005)(99936001)(5660300001)(31696002)(64126003)(85182001)(2900100001)(65826007)(256004)(7736002)(386003)(186003)(2501003)(52116002)(5250100002)(81166006)(81156014)(85202003)(53936002)(106356001)(99286004)(97736004)(6506007)(236005)(2906002)(66574009)(446003)(71200400001)(71190400001)(102836004)(26005)(76176011)(3846002)(6512007)(476003)(2616005)(8936002)(486006)(11346002)(54896002)(1730700003)(6306002)(6116002)(58126008)(5640700003)(8676002)(6486002)(6436002)(229853002)(2351001)(105586002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0701MB2127; H:VI1PR0701MB2736.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: AfIW6fSK7XV6FUt6NwnOsybrR57sZUUnL2lUow8xI4vfA8TTcUMozEMzipGwOpkHfMjnvtI+9lokrRy+KMiMbIiXgeqA2EJa6aGI62Uh88fVfat+bdTENlqbG4napq8qKl8M8SguMqgA8gaTos/8JRQEIYlTJA767x8aWvEW2rDNG3lg7KBH1C8PmlqkFc076JPD+IWlQw6oZf+nL9EuabKo9vmePKsf2Yo5m//+ea9RXQcnCcwChbeaWfu3ZaePRSeqtEBQ22nA7xubzFibkhIOM2bUvrNcQe18h9V/Hy1Pdel3A7C3N1q6JgLvvx75/EPFT/CRPdHNpIuZC6pSoQmhpYr3mlEmR/eAVrkR2Wo=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="------------ms000604000909090503080604"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 9e855568-7da9-4ac4-a67b-08d6304cebd8
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 14:13:47.4963 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB2127
X-OriginatorOrg: ericsson.com
X-Brightmail-Tracker: H4sIAAAAAAAAA1WSa0iTYRTHefa+294tB09L82CMaGV5SfNSUGleIMyQwCIhtJUjX7ykc+5d ptEHLa3UD6mkuBFpNKycqEwpFUNdDlreLfKSXZYKmREolaUl7d1jUN9+55z/+fM/Dw9DyYeF Xky6Rs/qNOpMpUhKG049zgtQNPYkBU0tSPbXjhYKo1CsyfRTEI8SpeEpbGZ6LqvbE5EsTTOP dAu140l5r5tWqQJkjy9FEgbwXrA03qdKkZSRYxuCtY8/RKT4jsDWahOTwiQAs2NAwBc0Lqeg YmhtfVItAMuDTiFvJsczCMaKg3kW4cNw/Uu3gGd3vAsMHc0injfhcGgpWRST/iEYnFuhCIfA pGPapaexNzzrfunylOFIeDh8lSb+kfBuoNfpwzASHAVN5VF8G+HNsPy80bVKYU+Ymq0VkNvc wTHaLyLsAfMza0LCSqj5NOViD6yCIrtRyN8CuAaBwWoQE9FuGByfRYQVMFZbhoioRwxFnUvr Tsdg7NcATQYvEDRXmig+Hb9d1R5N0p2Brrc31lNkw+CVtnWOg8JCO1WOgo3/BDc6rShcgqBo YlxkdD3ARrAbZmmj05bCO6G+WPm/nmd/qL+7QBEOg5qVXhHhbXCrzCEmvA8WbIuIcCjUN/0W 1SFpA/LgWI7LSg0JDWR16ec4LlsTqGH1FuT8Wr1tqwHtyLwQbUWYQUo32URxT5JcqM7l8rOs aIfT50OLeQR50ZpsDat0l9VlOMeyFHX+JVaXfVZ3IZPlrGgLQys9ZYENXYlynKrWs+dZVsvq /k4FjMSrAPlUBa2ptk4kMLa4476r8U8yWo3deKnPd7txpK637mT1Ne/lmPQ3Nd4jYz4Jxpmc r7H5lcITVlPH0UN9M22PclT68Gk/FQy5HemKkIe9dws5fe9AzivLRYdYPtf2NDHIOyauZYNM ofK/rP2mVX4uW2lWzSfX3jk4qbg9XSqpuNmvpLk0dbAfpePUfwCLlkmNYgMAAA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/P3yLraFAFpz0MoZwwn5vMeEUQC4>
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: Fri, 12 Oct 2018 14:13:55 -0000

Hello,

Thanks for all the replies. So preceding and following whitespace is not allowed.
However as I got similar questions often, and some RFC examples seem to indicate that it is allowed, I feel that an explanatory statement like the following would help YANG users.:

"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."

regards Balazs

On 2018. 10. 09. 10:59, Balázs Lengyel wrote:

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" rel="nofollow">https://tools.ietf.org/html/rfc7950#section-4.2.9

       <status xmlns=http://example.com/system" rel="nofollow">"http://example.com/system">
         The image example-fw-2.3 is being installed.
       </status>

https://tools.ietf.org/html/rfc7950#section-7.16.3" rel="nofollow">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" rel="nofollow">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 

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod" rel="nofollow">https://www.ietf.org/mailman/listinfo/netmod
-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909              email: Balazs.Lengyel@ericsson.com