Subject: [netmod] mandatory nodes with when

From: Ladislav Lhotka <[email-masked]>
Date: Sat, 29 Oct 2011 19:25:17 +0200

Hi,

I have problems with interpreting the following fragment:

leaf foo {
     type boolean;
}
leaf bar {
     when "../foo = 'true'";
     mandatory true;
     type uint8;
}

Now, what if the instance document (datastore) contains <foo>true</foo> 
but the <bar> element is missing? It is not correct to classify such a 
document as invalid because the context node for the 'when' XPath 
expresion (which is 'bar', according to RFC 6020, sec. 7.19.5) doesn't 
exist in the data tree, so the XPath expression is not well defined and 
cannot be evaluated.

But what is the correct answer?

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C