I have this in my xsd:
<xs:element name="Parameter" type="complex">
and I want to define complex like:
<xs:simpleType name="complex">
1 xs:decimal
2 xs:string
</xs:simpleType>
So if the value for Parameter is decimal to take decimal and if value is not decimal to assume that value is string. How to declare my complex type?
You’ll need a
complexTypetogether with a choice to express this:Edit: Based on your comments maybe this is worth a try:
But JAXB will translate this to
Stringanyway, so there’s no benefit from the union, at least with respect to the generated classes. And that you are using JAXB is just a guess.