Re: [netmod] xpath expressions in JSON

Qin Wu <bill.wu@huawei.com> Thu, 11 October 2018 02:46 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 14152130DFB for <netmod@ietfa.amsl.com>; Wed, 10 Oct 2018 19:46:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, 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 2kZ5xsO4QMTn for <netmod@ietfa.amsl.com>; Wed, 10 Oct 2018 19:46:22 -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 113AC130DF2 for <netmod@ietf.org>; Wed, 10 Oct 2018 19:46:22 -0700 (PDT)
Received: from lhreml707-cah.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 3D1C74723D4CF; Thu, 11 Oct 2018 03:46:17 +0100 (IST)
Received: from NKGEML412-HUB.china.huawei.com (10.98.56.73) by lhreml707-cah.china.huawei.com (10.201.108.48) with Microsoft SMTP Server (TLS) id 14.3.399.0; Thu, 11 Oct 2018 03:46:18 +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; Thu, 11 Oct 2018 10:46:16 +0800
From: Qin Wu <bill.wu@huawei.com>
To: Ladislav Lhotka <lhotka@nic.cz>, Martin Bjorklund <mbj@tail-f.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] xpath expressions in JSON
Thread-Index: AQHUYIq7R7zgxnWZykmBF8fDuM0qB6UX5bGAgAFx2HA=
Date: Thu, 11 Oct 2018 02:46:14 +0000
Message-ID: <B8F9A780D330094D99AF023C5877DABA9B064D6F@nkgeml513-mbx.china.huawei.com>
References: <20181010.131610.1510095762179710072.mbj@tail-f.com> <8736tevut6.fsf@nic.cz>
In-Reply-To: <8736tevut6.fsf@nic.cz>
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: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/wss6W7QdorVaohe9i-Honec2D8Y>
Subject: Re: [netmod] xpath expressions in JSON
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, 11 Oct 2018 02:46:24 -0000

-----邮件原件-----
发件人: netmod [mailto:netmod-bounces@ietf.org] 代表 Ladislav Lhotka
发送时间: 2018年10月10日 20:41
收件人: Martin Bjorklund; netmod@ietf.org
主题: Re: [netmod] xpath expressions in JSON

Martin Bjorklund <mbj@tail-f.com> writes:

> Hi,
>
> While reviewing restconf-notif, I saw this example:
>
>    {
>       "ietf-subscribed-notifications:input": {
>          "stream": "NETCONF",
>          "stream-xpath-filter": "/ds:foo/",
>          "dscp": "10"
>       }
>    }
>
> Note the "stream-xpath-filter".  It has a prefix in the XPath string.
> How are prefixes declared when JSON is used?
>
> The leaf "stream-xpath-filter" says:
>
>               o  The set of namespace declarations are those in scope on
>                  the 'stream-xpath-filter' leaf element.
>
> (I think I provided that text...)
>
> This assumes that the encoding is XML, or at leas that the encoding 
> can somehow transfer namespace declarations.

It can't. There are two options:

1. have different representations of this value in XML and JSON,
   analogically to instance indentifiers (sec. 6.11 in RFC 7951).

[Qin]: This has been brought up before:
https://www.ietf.org/mail-archive/web/netconf/current/msg15501.html

2. use a module name rather than a prefix in XML, too.

I would suggest #2.

Lada

>
> How is this supposed to work with JSON?
>
>
> /martin
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod