New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choice should support self-named elements #44

Closed
ghost opened this Issue May 21, 2011 · 1 comment

Comments

Projects
None yet
1 participant
@ghost

ghost commented May 21, 2011

Example schema:

<xs:complexType name="ProtocolType">
  <xs:choice minOccurs="1" maxOccurs="1">
    <xs:element name="HTTP"/>
    <xs:element name="TCP"/>
    <xs:element name="UDP"/>
  </xs:choice>
</xs:complexType>

should result in HTTP, TCP, and UDP case classes that can be used for any element or attribute of type "ProtocolType."

@ghost ghost assigned eed3si9n May 22, 2011

eed3si9n added a commit that referenced this issue May 24, 2011

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n May 24, 2011

Owner

According to the spec, the type of an element is defined as follows:

The type definition corresponding to the <simpleType> or <complexType> element information item in the children, if either is present, otherwise the type definition resolved to by the actual value of the type attribute, otherwise the {type definition} of the element declaration resolved to by the actual value of the substitutionGroup attribute, if present, otherwise the ur-type definition.

Since <xs:element name="HTTP"/> is missing type attribute, it defaults to xs:anyType, which maps to scalaxb.DataRecord[Any]. The problem is that the choice between xs:anyTypes were incorrectly mapped to scalaxb.DataRecord[scalaxb.DataRecord[Any]], which I now fixed.

Owner

eed3si9n commented May 24, 2011

According to the spec, the type of an element is defined as follows:

The type definition corresponding to the <simpleType> or <complexType> element information item in the children, if either is present, otherwise the type definition resolved to by the actual value of the type attribute, otherwise the {type definition} of the element declaration resolved to by the actual value of the substitutionGroup attribute, if present, otherwise the ur-type definition.

Since <xs:element name="HTTP"/> is missing type attribute, it defaults to xs:anyType, which maps to scalaxb.DataRecord[Any]. The problem is that the choice between xs:anyTypes were incorrectly mapped to scalaxb.DataRecord[scalaxb.DataRecord[Any]], which I now fixed.

@eed3si9n eed3si9n closed this May 24, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment