Martin Bjorklund je 25.11.2015 ob 11:16 napisal:
Ladislav Lhotka <lho...@nic.cz> wrote:
Hi,

I'd like to resolve this issue. Here is a complete example (valid, I believe):

module context {
   namespace "http://example.com/context";;
   prefix ctx;

   leaf foo {
     config false;
     type uint32;
   }
   rpc oper {
     output {
       must "/foo mod foo = 0";
       leaf foo {
         type uint32;
       }
     }
   }
}

1. What does the accessible tree look like?
Note that the anser to this depends on the outcomne of Y04.  Andy has
strong objections to Y04-02, and proposed Y04-04 instead.

Assuming Y04-02, and assuming /foo has the value 20 and the oper rpc's
result has foo = 10, the accessible tree would look like this:

    <root>
      +-- oper
      |   +-- foo = 10
      +-- foo = 20


(If we instead move back to Y04-04, the accessible tree would be:

    <root>
      +-- oper
          +-- foo = 10

)

2. What is the context node for the "must" expression?
  /oper

This change to the accessible tree (1.0 --> 1.1) may break some existing "when" XPath expressions (those under "output" statement). Is this compatible with 1.1 charter - "All compliant YANG 1.0 modules must be accepted as compliant YANG 1.1 modules"?

  rpc my-rpc {
    output {
      uses my-stuff {
        when "specific-param = 'foo'";// 1.0
// when "my-rpc/specific-param = 'foo'" // 1.1
      }
      leaf specific-param {
        type string;
      }
    }
  }

Jernej


/martin



Thanks, Lada

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

Ladislav Lhotka <lho...@nic.cz> wrote:
Hi,

Y02-01 allows "must" as a substatement of "input", "output" and
"notification" but for these cases the specification of the context
node in sec. 7.5.3 doesn't work.

    o  The context node is the node in the accessible tree for which the
       "must" statement is defined.
You are right.  But note how the accessible tree is defined.  There is
a node for the operation / notification.  This node should be the
context node:

    o  If the "must" statement is a substatement of a "notification"
       statement, the context node is the node representing the
       notification in the accessible tree.

    o  If the "must" statement is a substatement of a "input"
       statement, the context node is the node representing the
       operation in the accessible tree.

    o  If the "must" statement is a substatement of a "output"
       statement, the context node is the node representing the
       operation in the accessible tree.


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

_______________________________________________
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