acidjunk / pyang

Automatically exported from code.google.com/p/pyang
ISC License
0 stars 0 forks source link

choice inside choice #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If a mandatory choice is inside another choice, Schematron may report a false 
positive because the first bullet in Sec. 7.9.4 isn't properly implemented in 
gen-schematron.xsl. It happens e.g. for the following module:

module mandchoice {
  namespace "http://example.com/ns/mandchoice";
  prefix mc;

  container top {
    choice foobar {
      case foo {
        leaf baz {
          type uint8;
        }
        choice one-two {
          mandatory true;
          leaf foo1 {
            type uint8;
          }
          leaf foo2 {
            type uint8;
          }
        }
      }
      leaf bar {
        type uint8;
      }
    }
  }
}

Schematron requires either "foo1" or "foo2" to be present even if leaf "baz" is 
not present.  

Original issue reported on code.google.com by lada.lho...@gmail.com on 3 Apr 2014 at 8:32