0

I am having this XML response from Flickr API:

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<user id="myID">
    <username>myUserName</username>
</user>
</rsp>

I never used XML in Java before, how can I extract the following field data:
"rsp stat" should return ok
"username" should return myUserName

arleitiss
  • 1,304
  • 1
  • 14
  • 38
  • possible duplicate of [XML parsing of a variable string in JavaScript](http://stackoverflow.com/questions/649614/xml-parsing-of-a-variable-string-in-javascript) – Jonathan Hall Dec 10 '14 at 02:10

1 Answers1

0

You could go ahead and make your own parser, using regex or the sort. That would be a long way to do it.

A faster and more conveinient way of doing it would be using a library such as this one.

Constant
  • 780
  • 1
  • 5
  • 19