Subject: [yang-doctors] Fwd: [Technical Errata Reported] RFC6728 (4843)

From: Benoit Claise <[email-masked]>
Date: Wed, 26 Oct 2016 11:06:37 +0200

YANG doctors,

Can you please validate this.
Note: neither pyang, confdc, or yumadump-pro reports an error.

Regards, Benoit

-------- Forwarded Message --------
Subject: 	[Technical Errata Reported] RFC6728 (4843)
Date: 	Wed, 26 Oct 2016 01:30:58 -0700
From: 	RFC Errata System <[email-masked]>
To: 	[email-masked], [email-masked], [email-masked], 
[email-masked], [email-masked], [email-masked], 
[email-masked]
CC: 	[email-masked], [email-masked], [email-masked]

The following errata report has been submitted for RFC6728,
"Configuration Data Model for the IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Protocols".

--------------------------------------
You may review the report below and at:
http://www.rfc-editor.org/errata_search.php?rfc=6728&eid=4843

--------------------------------------
Type: Technical
Reported by: Michal Vasko <[email-masked]>

Section: 6

Original Text
-------------
           leaf isFlowKey {
             when "(name(../../..) != 'immediateCache')
...
       leaf activeTimeout {
         when "(name(..) = 'timeoutCache') or
           (name(..) = 'naturalCache')" {
...
       leaf idleTimeout {
         when "(name(..) = 'timeoutCache') or
           (name(..) = 'naturalCache')" {
...
       leaf exportInterval {
         when "name(..) = 'permanentCache'" {

Corrected Text
--------------
           leaf isFlowKey {
             when "(local-name(../../..) != 'immediateCache')
...
       leaf activeTimeout {
         when "(local-name(..) = 'timeoutCache') or
           (local-name(..) = 'naturalCache')" {
...
       leaf idleTimeout {
         when "(local-name(..) = 'timeoutCache') or
           (local-name(..) = 'naturalCache')" {
...
       leaf exportInterval {
         when "local-name(..) = 'permanentCache'" {

Notes
-----
The XPath function name() returns fully-qualified name (with namespace), but the comparisons are done on simple node names, which are returned by the local-name() XPath function.

Instructions:
-------------
This erratum is currently posted as "Reported". If necessary, please
use "Reply All" to discuss whether it should be verified or
rejected. When a decision is reached, the verifying party
can log in to change the status and edit the report, if necessary.

--------------------------------------
RFC6728 (draft-ietf-ipfix-configuration-model-11)
--------------------------------------
Title               : Configuration Data Model for the IP Flow Information Export (IPFIX) and Packet Sampling (PSAMP) Protocols
Publication Date    : October 2012
Author(s)           : G. Muenz, B. Claise, P. Aitken
Category            : PROPOSED STANDARD
Source              : IP Flow Information Export
Area                : Operations and Management
Stream              : IETF
Verifying Party     : IESG
.

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 26 Oct 2016 11:17:19 +0200 (CEST)

> Can you please validate this.

The proposed errata text is correct.

> Note: neither pyang, confdc, or yumadump-pro reports an error.

It is not a YANG bug so a YANG compiler can't really find it.  The bug
is that the XPath expression (while being correct) will always return
false.  (hmm, a clever compiler doing compile-time partial evaluation
could give a warning for this.)

/martin

> The XPath function name() returns fully-qualified name (with
> namespace), but the comparisons are done on simple node names, which
> are returned by the local-name() XPath function.
> 
> Instructions:
> -------------
> Title : Configuration Data Model for the IP Flow Information Export
> (IPFIX) and Packet Sampling (PSAMP) Protocols

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 26 Oct 2016 16:46:29 +0200

> On 26 Oct 2016, at 11:17, Martin Bjorklund <[email-masked]> wrote:
> 

The text in "Notes" is not strictly correct, see below. I would simply say:

The result of the name() function depends on particular namespace declarations in the instance XML document, and is thus not deterministic in YANG context. That's why this function SHOULD NOT be used in YANG modules [draft-ietf-netmod-rfc6087bis].

> false.  (hmm, a clever compiler doing compile-time partial evaluation

Not true: the name() function returns the same result as local-name() if the argument uses the default namespace in the instance document:

$ cat name.xml
<top xmlns="http://example.org/foo"/>

$ cat name.xsl
<?xml version="1.0"?>
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
	    xmlns:foo="http://example.org/foo"
	    version="1.0">
  <output method="text"/>

  <template match="/">
    <value-of select="name(foo:top)"/>
    <text>&#xA;</text>
  </template>

</stylesheet>

$ xsltproc name.xsl name.xml
top

Lada

> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C