membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
94 stars 73 forks source link

Annotation should be allowed as child for ComplexContent #205

Closed helpermethod closed 10 years ago

helpermethod commented 10 years ago

According to http://www.w3schools.com/schema/el_complexcontent.asp and the RuntimeException's message annotation should be allowed as a child element for ComplexType. But as can be seen in the following code snippet there exists no case block for annotation:

protected parseChildren(token, child, params) {
    switch (child ){
      case 'extension' :
      derivation = new Extension(schema: schema) ; break
      case 'restriction' :
      derivation = new Restriction(schema: schema); break
      default: throw new RuntimeException("Invalid child element '$child' in complexContent. Possible elements are 'anotation', 'extension' or 'restriction'.")
    }
    derivation.parse(token, params) 
  }
keshavarzi commented 10 years ago

Parsing annotaion is placed in the abstract class SchemaComponent but the following line was missing!

super.parseChildren(token, child, params)