Do not pretty-print body class
[yangtools.git] / yang / yang-data-impl / src / test / resources / leafref-context-test / correct-modules / leafref-test.yang
1 module leafref-test {
2     namespace "pk.test";
3     prefix tst;
4
5     import import-mod { prefix imp; revision-date 2014-10-07; }
6
7     revision 1999-09-09 {
8         description
9                 "Yang initial revision";
10     }
11
12     container odl-contributor {
13         list contributor {
14             key "login";
15             leaf login {
16                 type string;
17             }
18             leaf contributor-name {
19                 type string;
20             }
21             leaf odl-project-name {
22                 type leafref {
23                     path "/odl-project/project/name";
24                 }
25             }
26         }
27         list noleafref-contributor {
28             leaf foo {
29                 type string;
30             }
31         }
32     }
33
34     container odl-project {
35         list project {
36             key "name";
37             leaf name {
38                 type string;
39             }
40             leaf project-lead {
41                 type leafref {
42                     path "../../../tst:odl-contributor[imp:foo=current()/bar]/contributor[tst:odl-project-name
43                                         = current()/../imp:name][odl-project-name2 = current()/../../imp:name/tst:name2][imp:odl-project-name3
44                                         = current()/../../imp:name/imp:name2]/tst:login";
45                 }
46             }
47             leaf project-lead2 {
48                 type leafref {
49                     path "/odl-contributor[foo=current()/bar]/contributor[odl-project-name
50                                         = current()/../name][odl-project-name2 = current()/../../name/name2][odl-project-name3
51                                         = current()/../../name/name2]/login";
52                 }
53             }
54
55             choice ch1 {
56                 case c1 {
57                     choice ch2 {
58                         case c1 {
59                             leaf l1 {
60                                 type leafref {
61                                     path "../../con1/l1";
62                                 }
63                             }
64                         }
65                         case c2 {
66                         }
67                     }
68                 }
69                 case c2 {
70                 }
71             }
72         }
73         list noleafref-project {
74             leaf foo {
75                 type string;
76             }
77         }
78         container con1 {
79             leaf l1 {
80                 type empty;
81             }
82         }
83     }
84
85     container con1 {
86         container con2 {
87             container con3 {
88                 leaf l1 {
89                     type leafref {
90                         path "/odl-project/project/name";
91                     }
92                 }
93                 leaf l2 {
94                     type leafref {
95                         path "/odl-project/project/name";
96                     }
97                 }
98                 leaf l3-noleafref {
99                     type int16;
100                 }
101             }
102             leaf l4 {
103                 type leafref {
104                     path "/odl-project/project/name";
105                 }
106             }
107             leaf l5-noleafref {
108                 type int16;
109             }
110         }
111         leaf l6 {
112             type leafref {
113                 path "/odl-project/project/name";
114             }
115         }
116         leaf l7-noleafref {
117             type int16;
118         }
119     }
120
121     leaf l8 {
122         type leafref {
123             path "/odl-project/project/name";
124         }
125     }
126
127     container no-leafrefcontainer {
128         list no-leafreflist {
129             leaf bar {
130                 type string;
131             }
132         }
133         container no-leafrefcontainer2 {
134             leaf baz {
135                 type string;
136             }
137         }
138     }
139
140     container no-leafrefcontainer2 {
141         list no-leafreflist {
142             leaf bar {
143                 type string;
144             }
145         }
146         container no-leafrefcontainer2 {
147             leaf baz {
148                 type string;
149             }
150         }
151     }
152 }