I have an xml having same tags (<value> tag) as given below:
<number>
<type>decimal</type>
<value>12</value>
<value>14</value>
</number>
I am trying to parse using either Digester or JAXB (without Schema). What I have done is I have created a java class that will map with the given xml. For this I have getter and setter methods for the <type> tag as:
String type;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
In Digester Rule xml file I have added the binding rule for the <type> tag as:
<bean-property-setter-rule pattern="type"/>
This will map the <type> tag in the xml with the 'type' property in the java class.
My problem is how to map <value> tag with the java class ?
How will I create the getter and setter methods for the <value> tag and also how will I set its digester rule in the Digester Rule xml file.
I need to store the values to either ArrrayList or Vector.
Thanks in advance.