Hi,

current text in 6087bis-04 (Section 5.6.4):

   XPath expressions for 'when' statements SHOULD NOT reference the
   context node or any descendant nodes of the context node.  They MAY
   reference descendant nodes if the 'when' statement is contained
   within an 'augment' statement, and the referenced nodes are not
   defined within the 'augment' statement.

This is OK. But the text never mentions an analogous case, which is when a when-stmt is defined for a uses-stmt. I think this should be corrected. Note that finding the initial context node for the expression uses an algorithm that is virtually equal to the 'augment' case (first data node ancestor), therefore the first sentence in the above text discourages use of 'when' statements within a 'uses' statement, which I don't think was the intention.

  grouping special-params {
    leaf param1 {
      type string;
    }
    leaf param2 {
      type string;
    }
  }

  container foo {
    leaf enable-special {
      type boolean;
    }
    uses special-params {
      when "enable-special = 'true'";
    }
  }

In my example the expression references a descendant of the initial context node, which should be OK. What would be problematic is referencing descendants that are defined in the grouping.

OLD:

   XPath expressions for 'when' statements SHOULD NOT reference the
   context node or any descendant nodes of the context node.  They MAY
   reference descendant nodes if the 'when' statement is contained
   within an 'augment' statement, and the referenced nodes are not
   defined within the 'augment' statement.

NEW:

   XPath expressions for 'when' statements SHOULD NOT reference the
   context node or any descendant nodes of the context node.  They MAY
   reference descendant nodes if the 'when' statement is contained
   within an 'augment' statement, and the referenced nodes are not
   defined within the 'augment' statement. They MAY also reference
   descendant nodes if the 'when' statement is contained within a
   'uses' statement, and the referenced nodes are not defined within
   the 'grouping' statement being referred to by the 'uses' statement.

Or something similar.

Jernej


internet-dra...@ietf.org je 6.7.2015 ob 19:14 napisal:
A New Internet-Draft is available from the on-line Internet-Drafts directories.
  This draft is a work item of the NETCONF Data Modeling Language Working Group 
of the IETF.

         Title           : Guidelines for Authors and Reviewers of YANG Data 
Model Documents
         Author          : Andy Bierman
        Filename        : draft-ietf-netmod-rfc6087bis-04.txt
        Pages           : 52
        Date            : 2015-07-06

Abstract:
    This memo provides guidelines for authors and reviewers of Standards
    Track specifications containing YANG data model modules.  Applicable
    portions may be used as a basis for reviews of other YANG data model
    documents.  Recommendations and procedures are defined, which are
    intended to increase interoperability and usability of Network
    Configuration Protocol (NETCONF) implementations that utilize YANG
    data model modules.


The IETF datatracker status page for this draft is:
https://datatracker.ietf.org/doc/draft-ietf-netmod-rfc6087bis/

There's also a htmlized version available at:
https://tools.ietf.org/html/draft-ietf-netmod-rfc6087bis-04

A diff from the previous version is available at:
https://www.ietf.org/rfcdiff?url2=draft-ietf-netmod-rfc6087bis-04


Please note that it may take a couple of minutes from the time of submission
until the htmlized version and diff are available at tools.ietf.org.

Internet-Drafts are also available by anonymous FTP at:
ftp://ftp.ietf.org/internet-drafts/

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


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

Reply via email to