How to read the XML tags(Element) from a XML file using JAXB or other API
843834Aug 26 2005 — edited Nov 6 2007Hi,
I want to read the XML file with its Tag name(Element) and the value present in this Tag. I can read the values present in the Tag by using the JAXB API, but want to read the Tag Name also.
How can i do this?
Here is one example-
<BgColor>
<BgRed>250</BgRed>
<BgGreen>153</BgGreen>
<BgBlue>53</BgBlue>
</BgColor>
Now i get the values 250,153,53 but i do not know how to read BgRed, BgGreen, BgBlue.
I want to put i HashMap like this-
KEY VALUE
BgRed 250
BgGreen 153
BgBlue 53
How can i do his?
Thanks in advance.