Re: [netmod] XPath node type tests

Robert Wilton <rwilton@cisco.com> Fri, 20 October 2017 16:24 UTC

Return-Path: <rwilton@cisco.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 60C5F1342CE for <netmod@ietfa.amsl.com>; Fri, 20 Oct 2017 09:24:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 uFVGG_Rwrc1b for <netmod@ietfa.amsl.com>; Fri, 20 Oct 2017 09:24:45 -0700 (PDT)
Received: from aer-iport-3.cisco.com (aer-iport-3.cisco.com [173.38.203.53]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DB8661330AE for <netmod@ietf.org>; Fri, 20 Oct 2017 09:24:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1574; q=dns/txt; s=iport; t=1508516684; x=1509726284; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=LRj5uskWQ8NmjWUqeL96+mFZqyqBhGxo1EOkqytc6E0=; b=ARsj9heq24bU0WMbSB09FtDbmNddDTmX/E4zMzYDa8H8GjfcyV66H6n3 KCl9Gpm/L896V4W/lzN68HfPwihRP79CNLNN0pJzuJIBT5ffc8oWcgDRa /h/kzBrymri6zk2qaR8B3TtsQnWEaYX8nCa+YlF/xzEa7pU1QjrCjCI8w Q=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DPAAAlIupZ/xbLJq1cGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBhEM5NSeDeoofdJAeJpY3ghEKGAuESU8ChHoYAQIBAQEBAQEBax0?= =?us-ascii?q?LhR0BAQEBAgEBASEPAQU2GwsYAgImAgInMAYNBgIBAYoUCBCqWYInix8BAQEBA?= =?us-ascii?q?QEBAwEBAQEBAQEcBYEPgh+DV4FpKQuCdogZgmEFoV+UcYtqhzWOF4djgTkfOIF?= =?us-ascii?q?bNCEIHRVJgmSEYD82imABAQE?=
X-IronPort-AV: E=Sophos;i="5.43,405,1503360000"; d="scan'208";a="656473480"
Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2017 16:24:41 +0000
Received: from [10.63.23.135] (dhcp-ensft1-uk-vla370-10-63-23-135.cisco.com [10.63.23.135]) by aer-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id v9KGOfNo013042 for <netmod@ietf.org>; Fri, 20 Oct 2017 16:24:41 GMT
To: "netmod@ietf.org" <netmod@ietf.org>
References: <aba8fca4-4cc7-ee66-6adf-baac5485b12a@cisco.com> <87h8utg7q8.fsf@nic.cz>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <4b74f390-4817-9154-e427-cd879e0ceeb9@cisco.com>
Date: Fri, 20 Oct 2017 17:24:41 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
MIME-Version: 1.0
In-Reply-To: <87h8utg7q8.fsf@nic.cz>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/QA8jRMDAvxyhx0iIrTwmxaVYzyE>
Subject: Re: [netmod] XPath node type tests
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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, 20 Oct 2017 16:24:47 -0000

Hi Lada,

Thanks for the explanation, that makes sense.


On 20/10/2017 16:27, Ladislav Lhotka wrote:
> Hi Rob,
>
> Robert Wilton <rwilton@cisco.com> writes:
>
>> Hi,
>>
>> XPATH 1.0 defines the following three node-type tests:
>>
>> 1) comment()
>> 2) processing-instruction(<opt arg>)
>> 3) text()
> For completeness, node() is the fourth one.
>
>> My assumption is that a YANG tree doesn't contain any nodes of type
>> 'comment' or 'processing-instruction' and hence these filters would
>> never match any nodes.
> Yes. FWIW, Yangson library raises NotSupported exception upon
> encountering these.
>
>> However, it wasn't clear to me from reading 7950 or rfc6087bis-14
>> whether text() matches anything.  In particular, does a YANG leaf node
>> (except of type empty) always parent a text node that holds its value?
> I believe this is how it should be interpreted. According to XPath 1.0
> spec, comparisons like
>
>      xyz = 'foo'
>
> use string-value of xyz node, which is defined as the concatenation of
> the string-values of all text node descendants of xyz.
Yes.  I don't think that I've ever come across for XPath usage in YANG 
where the "concatenation of the string-values of all text node 
descendants " is actually useful (particularly as the children nodes are 
likely to not be consistently ordered).

Thanks,
Rob


>
> Lada
>
>> Thanks,
>> Rob
>>
>>
>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod