Martin Bjorklund je 28.9.2015 ob 14:51 napisal:
Jernej Tuljak <jern...@mg-soft.si> wrote:
Martin Bjorklund je 28.9.2015 ob 12:15 napisal:
Jernej Tuljak <jern...@mg-soft.si> wrote:
Martin Bjorklund je 25.9.2015 ob 15:22 napisal:
Jernej Tuljak <jern...@mg-soft.si> wrote:
Ladislav Lhotka je 25.9.2015 ob 13:44 napisal:
Jernej Tuljak <jern...@mg-soft.si> writes:

Ladislav Lhotka je 25.9.2015 ob 9:58 napisal:
Jernej Tuljak <jern...@mg-soft.si> writes:

A context node always exists in the schema tree.
The context node is in the data tree.

IMO, this
needs to be fixed in order to prevent the interpretation I came up
with (and also Balazs, independently). This interpretation was clearly
not the intention.

NEW:

      The XPath expression is conceptually evaluated in the following
      context, in addition to the definition inSection 6.4.1
      
<https://tools.ietf.org/html/draft-ietf-netmod-rfc6020bis-07#section-6.4.1>:

      o If the "when" statement is a child of an "augment" statement, then
         the context node is the augment's target node in the data tree,
         if
         the target node is a data node.  Otherwise, the context node is
         the closest ancestor node to the target node that is also a data
         node. If no such node exists, the context node is the root node.

      o  If the "when" statement is a child of a "uses", "choice", or
         "case" statement, then the context node is the closest ancestor
         node to the "uses", "choice", or "case" node that is also a data
         node.  If no such node exists, the context node is the root node.

      o  If the "when" statement is a child of any other data definition
         statement, the context node is the node in the accessible tree
         for
         which the "when" statement is defined.
             If an instance of the context node does not exist during
             processing
      of the XPath expression, the context node is tentatively
      instantiated
      as a single dummy node with the same name, but with no value and no
      children, and merged into the instance of the accessible tree.

      The result of the XPath expression is converted to a boolean value
      using the standard XPath rules.

      An XPath expression MUST NOT reference nodes that are made
      conditional
      by the "when" statement that defines it.

      If the XPath expression references any node that also has associated
      "when" statements, these "when" expressions MUST be evaluated first.

      There MUST NOT be any circular dependencies in these "when"
      expressions.

Something like this also takes care of Martin's example ("* = 42").
How?  It is not clear to me if the '*' is legal or not.
It just occurred to me that it is very hard to not reference the
context node in a "when" XPath expression, since the context node is
always your initial XPath context (you always start with a node-set of
size 1, containing the context node).

"../bar" says, select the parent of the context node, then select
"bar" child
"*" says, select the children of the context node that are also
element nodes

So, yeah, "MUST NOT reference conditional nodes" doesn't work.
So do you think that my proposed text about "tentatively remove all
conditional nodes" works?
Not sure anymore:

   grouping foo {
     leaf mandatory-foo1 {
       type string;
       mandatory true;
     }
   }

   container top {
     leaf enable {
       type boolean;
     }
     container foo {
       uses foo {
         when "../enable = 'true'";
       }
     }
   }

   augment "/top/foo" {
     when "../enable = 'true'";
     leaf mandatory-foo2 {
       type string;
       mandatory true; // local augment
     }
   }

For the following instance:

"top": { "enable": "true" }

Note that the context node (container "foo") does not exist.
It actually exists, since all NP-containers exists, according to:

    If a node that exists in the accessible tree has a non-presence
    container as a child, then the non-presence container also exists in
    the tree.

Missed that. The text you proposed should be fine then. Takes care of both problems, the missing context node and references to conditional nodes in one go.

Jernej



/martin

_______________________________________________
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