I need to generate XML that confirms to this XSD:
<xsd:element name="Line" type="Line" minOccurs="0" maxOccurs="3"/>
So that the output is like:
<root>
<Line>A</Line>
<Line>B</Line>
<Line>C</Line>
</root>
The problem is that if I annotate the variables in the Java bean like:
@JsonProperty("Line")
private String Line1;
@JsonProperty("Line")
private String Line2;
@JsonProperty("Line")
private String Line3;
Then I get an exception and if I use a List
then the output comes out wrong, like:
<root>
<Line>
<Line>1 New Orchard Road</Line>
<Line>Armonk</Line>
</Line>
</root>
With a parent <Line>
element in excess. Is there a way around this?