Question: a) Write code using JAXB to parse through an XML string and return the data. No main class so return the value. Hint : Will

a) Write code using JAXB to parse through an XML string and return the data.
No main class so return the value. Hint: Will need XmlStreamReader and Unmarshalling.
b) Create an @XmlElement Annotation class to map elements from the XML string.

XML String -


John
Josh


Ben
10



Expected outpout -
{
"Books": {
"book": [
{
"name": "John",
"author": "Josh"
},
{
"name": "Ben",
"author": 10
}
]
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!