I have a file like this :
1,<note><from>Messi</from><body>Don't forget me this weekend!</body></note>
2,<note><from>Ronaldo</from><body>Don't forget Laliga</body></note>
3,<note><from>Neymar</from><body>I am the best </body></note>
4,<note><from>Suarez</from><body>Don't forget me this weekend!</body></note>
where first field is id and second field is the data. I need to load this to an RDD, parse the xml string and extract fields, and create another RDD like this:
1,Messi,Don't forget me this weekend!
2,Ronaldo,Don't forget Laliga
3,Neymar,I am the best
4,Suarez,Don't forget me this weekend!
Since the xml in actual scenario is complex, I would like to use an xml parser. How can I do this?