Subject: [netmod] deleting NP containers wrt/ XPath evaluation

From: Andy Bierman <[email-masked]>
Date: Tue, 5 Apr 2011 11:38:42 -0700

Hi,

I need help determining how a standards-compliant server will implement this
must-stmt below:

  list top {
      key x;
      leaf x { type int32; }

     leaf y {
         type string;
         must "../np1/a >= 4";
     }

      container np1 {
           leaf a {
               type int32;
               default 42;
          }
     }
}

let's say the /top/np1 container is not instantiated at all, and the default=42 is implemented internally.
If with-defaults=trim and the np1/a leaf is set to 42, then the server may delete it.

Is the server required to come up with the same XPath result for the 'must-stmt' in leaf y,
even if the server deletes empty NP containers?  It seems to me 2 different results would
happen depending on whether this 'MAY delete' option is used or not.

Does an empty NP container exist for XPath purposes?

thanks,
Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 6 Apr 2011 07:56:13 +0200

On Apr 5, 2011, at 8:38 PM, Andy Bierman wrote:

>          must “../np1/a >= 4”;
> let’s say the /top/np1 container is not instantiated at all, and the default=42 is implemented internally.
> Is the server required to come up with the same XPath result for the ‘must-stmt’ in leaf y,
> happen depending on whether this ‘MAY delete’ option is used or not.
>  

IMO, it does exist because the context for evaluating the XPath expression assumes all leafs with default values to be present, and hence the np1 container. The DSDL validation procedure as described in sec. 7 of RFC6110 would add both "np1" and "a" to an instance document, if they were missing, before validating the semantic constraints.

Lada

>  
>  
> thanks,
> Andy
>  
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 06 Apr 2011 09:45:33 +0200 (CEST)

Ladislav Lhotka <[email-masked]> wrote:
> IMO, it does exist because the context for evaluating the XPath expression
> assumes all leafs with default values to be present, and hence the np1
> container.

Yes, this is correct.

/martin