Subject: [netmod] more fun with when-stmt

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

Hi,

What about this one?

   list split {
     min-elements 2;
     when "B = 'fred';
     key A;
     leaf A { type string; }
     leaf B {
        type string;
        mandatory true;
     }
   }

<config>
   <split>
     <A>here</A>
     <B>fred</B>
   </split>
   <split>
     <A>not-here</A>
     <B>barney</B>
   </split>
</config>

Does the when-stmt refer to the existence of the
object (split) or instances of the object?
The draft seems to say the former.
It is not clear to mean what the proper outcome
should be for agent processing.

If instances, not objects:
Does the 'min-elements 2' get enforced or not?

Is the when-stmt test in 'split' conducted
before or after the min-elements test in 'config'?
If before, no error, if after (2nd entry deleted),
then it is an error.

Will a CLR saying that "a when-stmt XPath expression MUST NOT
include any references to child, descendant, or descendant-or-self
nodes of the context node" fix this problem?

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 22 Mar 2009 15:22:43 -0700 (PDT)

Hi,

> The draft seems to say the former.

I'm not sure where it indicates the former; the idea is that works on
instances.  Section 7.9.15 defines this, using the term "data tree"
which is the tree of instances.

> nodes of the context node" fix this problem?

I think so, yes.  Unless anyone else has any other comments, I will
add this.

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 23 Mar 2009 11:26:09 -0700 (PDT)

> I think so, yes.  Unless anyone else has any other comments, I will

I think we have to mention self as well, and self is also part of
ancestor-or-self.  How about this instead:

  The XPath expression MUST NOT include any references to the context
  node or any descendants of the context node.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Wed, 25 Mar 2009 23:26:23 -0700

>   node or any descendants of the context node.

much better

Andy