XML : JAXB unmarshalling xml both @XmlValue and @XmlElement

Hi I am unmarshalling a XML file that has a tag that can contain both a value or a list of elements. I was wondering what the best approach is for unmarshalling this kind of XML. Example:

  <attributes>      <attribute>value1</attribute>      <attribute>value2</attribute>      <attribute>value3</attribute>      <attribute>value4</attribute>      <attribute>          <value>value11</value>          <value>value12</value>          <value>value13</value>          <value>value14</value>          <value>value15</value>      </attribute>      <attribute>value5</attribute>      <attribute>value6</attribute>  </attributes>    

I can't change the way of how the XML is build up so I am hoping someone has a answer. Thank you.

No comments:

Post a Comment