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

"Adrian Farrel" <adrian@olddog.co.uk> Tue, 09 October 2018 10:17 UTC

Return-Path: <adrian@olddog.co.uk>
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 DA352131250 for <netmod@ietfa.amsl.com>; Tue, 9 Oct 2018 03:17:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, 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 7K9AHDhDrkeE for <netmod@ietfa.amsl.com>; Tue, 9 Oct 2018 03:17:54 -0700 (PDT)
Received: from mta8.iomartmail.com (mta8.iomartmail.com [62.128.193.158]) (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 E50D613123D for <netmod@ietf.org>; Tue, 9 Oct 2018 03:17:53 -0700 (PDT)
Received: from vs1.iomartmail.com (vs1.iomartmail.com [10.12.10.121]) by mta8.iomartmail.com (8.14.4/8.14.4) with ESMTP id w99AHnJW003852; Tue, 9 Oct 2018 11:17:49 +0100
Received: from vs1.iomartmail.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F09482203C; Tue, 9 Oct 2018 11:17:48 +0100 (BST)
Received: from asmtp3.iomartmail.com (unknown [10.12.10.224]) by vs1.iomartmail.com (Postfix) with ESMTPS id E4C3522044; Tue, 9 Oct 2018 11:17:48 +0100 (BST)
Received: from 950129200 ([12.208.209.2]) (authenticated bits=0) by asmtp3.iomartmail.com (8.14.4/8.14.4) with ESMTP id w99AHkod005591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Oct 2018 11:17:47 +0100
Reply-To: <adrian@olddog.co.uk>
From: "Adrian Farrel" <adrian@olddog.co.uk>
To: "'Martin Bjorklund'" <mbj@tail-f.com>, <balazs.lengyel@ericsson.com>
Cc: <netmod@ietf.org>
References: <14e78aaa-4508-970a-d1a0-e091ffaf5c8e@ericsson.com> <20181009.120705.20836607492685594.mbj@tail-f.com>
In-Reply-To: <20181009.120705.20836607492685594.mbj@tail-f.com>
Date: Tue, 9 Oct 2018 11:17:45 +0100
Message-ID: <034601d45fb9$53c73660$fb55a320$@olddog.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-gb
Thread-Index: AQJPOwHnoc3cs7ewtfatWZq/1xPcNwHFiAiFpBLQNjA=
X-Originating-IP: 12.208.209.2
X-Thinkmail-Auth: adrian@olddog.co.uk
X-TM-AS-GCONF: 00
X-TM-AS-Product-Ver: IMSVA-9.0.0.1623-8.2.0.1013-24144.006
X-TM-AS-Result: No--18.217-10.0-31-10
X-imss-scan-details: No--18.217-10.0-31-10
X-TMASE-Version: IMSVA-9.0.0.1623-8.2.1013-24144.006
X-TMASE-Result: 10--18.216600-10.000000
X-TMASE-MatchedRID: 6lay9u8oTUO0F82n+3va/3FPUrVDm6jt8GRhP/nTHNYrg7c3DY6jHcLm p4jPUF8trZqX9okZ7jD+w331TsHWuyqDVw6LinnHJrUxoq6hvw9+Mk6ACsw4JqN0vJETjYT21IS 0AS8acjt966XoOdpv0N0s4NX/eh4Ied6FhOj8IzpjBolet/YhdA0FwM3hFTalWSMW3+mJJ3Xqzk hCUQRGl9TfG5hYf1XwPYfQ1OxjITiY+BJXPkRKFkdAWPMBu8kQDvJ43UwBMxTb6Y+fnTZUL6tlt 7GxwXI+as3bPG6MbcqKlO3LpEVWHxvgHIDSxZX6ztFnzYQp41wxmbT6wQT2a0JqedX9vt/ZNst7 Vux2Zs6en249c8P4sVnXkQR++JUZkVF44oU3/QjCtSG/SQAC8XWT6A/Vdqa0myiLZetSf8nkA/7 Kqi9JmRre5nbuJbxORjjVhf+j/wqLZAVphLW/bSq2rl3dzGQ1SPqUqJpSCRvDjgcY22FUY8DZ03 dQrq1aDQvRn1Ed3q6cd8zfOACHzA==
X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/dM0JhjxqkEG7ZngAWabD7WCkhws>
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 10:17:57 -0000

Hence why we go through so many hoops in the line-wrapping draft.

Adrian

> -----Original Message-----
> From: netmod [mailto:netmod-bounces@ietf.org] On Behalf Of Martin Bjorklund
> Sent: 09 October 2018 11:07
> To: balazs.lengyel@ericsson.com
> Cc: netmod@ietf.org
> Subject: Re: [netmod] Whitespace in XML encoding - allowed ?
> 
> Balázs Lengyel <balazs.lengyel@ericsson.com> 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.
> 
> For example, RFC 7950 says about integers in 9.2.1:
> 
>    An integer value is lexically represented as an optional sign ("+" or
>    "-"), followed by a sequence of decimal digits.  If no sign is
>    specified, "+" is assumed.
> 
> So, space characters (and other characters) are not allowed.  In XML,
> whitespace has meaning, so:
> 
>    <foo>42</foo>
> 
> is not the same as
> 
>    <foo> 42 </foo>
> 
> Since the string " 42 " is not a legal integer lexical representation
> according to 9.2.1, <foo> 42 </foo> is not a valid XML representation
> for the integer foo.
> 
> > 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">
> >          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>
> 
> Yes, to be strict, these examples should have had some text that
> explained that whitespace was added for readability.  New documents
> will hopefully use the new artwork draft's rules instead.
> 
> 
> 
> /martin
> 
> 
> > 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