Subject: [netmod] when-stmt processing

From: Andy Bierman <[email-masked]>
Date: Sun, 08 Mar 2009 14:00:08 -0700

Hi,

There seems to be a chicken-and-egg evaluation problem
with the when-stmt.

The agent needs to skip any nodes that are currently
'not really present' because of false when-stmts
(also false if-feature, but that is static, out-of-band,
and easy).

   list foo {
     key A;

     leaf A { type string; }

     leaf B {
       mandatory true;
       when ". = 'fred'";
       type string;
     }

     container C {
       when "D = 'fred'";
       leaf D { type string; }
     }
   }

Seems difficult to check whether B or D should exist
if any 'descendant-or-self' nodes are involved in
the XPath expression.

Let's say /foo[A='bar'] exists, but not the child node 'B'.
How can B be used as the context node for XPath evaluation
if it doesn't exist?  This is needed to prevent a false error
for a missing mandatory leaf B.

Andy