Subject: [YANG] usage of container statement inside choice?

From: Jason Nixon <[email-masked]>
Date: Tue, 12 Oct 2010 17:35:31 -0700

All,
Every example of a choice statement I have seen so far uses a leaf to define the information for a particular case.
Yet I am wondering if the below example would be allowed?
I am assuming that groupings of dogtreat, and feed_cow are defined elsewhere, and may have multiple leaf objects defined inside.
Thanks for your thoughts on this,
Jason Nixon

choice moof
                        {
                            description "is it a cow or a dog";
                                    case dog
                                    {
                                        container dog
                                        {
                                            description "awww puppies are cute";
                                                    uses dogtreat;
                                        }
                                    }
                                    case cow
                                    {
                                        container cow
                                        {
                                            description "got some hay?";
                                                    uses feed_cow;
                                        }
                                    }
                       }//end choice

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 13 Oct 2010 17:18:44 +0200

Hi Jason,

this is certainly possible, and the 'case' statements may also be
omitted as there is only one node per case.

Lada

On Út, 2010-10-12 at 17:35 -0700, Jason Nixon wrote:
> All, 
> 
> Every example of a choice statement I have seen so far uses a leaf to
> define the information for a particular case.
> 
> I am assuming that groupings of dogtreat, and feed_cow are defined
> elsewhere, and may have multiple leaf objects defined inside.
> 
> _______________________________________________
> YANG mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C