> On 20 Oct 2015, at 10:45, Martin Bjorklund <[email protected]> wrote: > > Ladislav Lhotka <[email protected]> wrote: >> Martin Bjorklund <[email protected]> writes: >> >>> Ladislav Lhotka <[email protected]> wrote: >>>> Hi, >>>> >>>> I can't find any text in 6020bis that deals with the following issue: >>>> >>>> leaf foo { >>>> when "false()"; >>>> mandatory true; >>>> type empty; >>>> } >>>> >>>> Now, sec. 7.6.5 (The leaf's mandatory Statement) says: >>>> >>>> o Otherwise, the leaf MUST exist if the ancestor node exists in the >>>> data tree. >>>> >>>> So, if we assume the ancestor node exists in the data tree, the leaf MUST >>>> exist. >>>> >>>> But sec. 8.1 (Constraints on Data) says: >>>> >>>> The following properties are true in all data trees: >>>> >>>> … >>>> >>>> o There MUST be no nodes tagged with "when" present if the "when" >>>> condition evaluates to "false" in the data tree. >>>> >>>> The "mandatory" and "when" statements contradict each other. How is >>>> this resolved? >>> >>> The idea is that a false when works like if-feature - if the when >>> evaluates to false then the mandatory constraint doesn't apply. >> >> I would personally prefer if "mandatory" was harder than "when" > > But then it would never be possible augment mandatory nodes (see that > other thread).
Yes, that's why I think "when" is indispensable only as a substatement of "augment", and it is also where the context node problem (Y18) doesn't exist at all. > >> because >> it is a schema constraint that can be determined upfront (so is >> "if-feature"), whereas "when" needs in principle a complete data tree to >> perform the evaluation. >> >> But either way, there should be a text that states that false "when" >> wins over mandatory, or the other way around. I can't find any in -08, >> section 8 doesn't mention "mandatory" at all. > > Ok. It needs to be added for "min-elements" as well: > > OLD: > > o The "min-elements" and "max-elements" constraints are enforced for > lists and leaf-lists. > > NEW: > > o The "mandatory" constraint is enforced for leafs, unless the node > or any of its ancestors has a "when" condition or "if-feature" > expression that evaluates to "false". > > o The "min-elements" and "max-elements" constraints are enforced for > lists and leaf-lists, unless the node or any of its ancestors has > a "when" condition or "if-feature" expression that evaluates to > "false". OK. Lada > > > /martin -- Ladislav Lhotka, CZ.NIC Labs PGP Key ID: E74E8C0C _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
