vendredi 22 juillet 2016

How to get specified roots from xml?

I have XML file like below

<?xml version="1.0" encoding="utf-8"?>
<Movies>
    <servername>
           raaja
    </servername>
    <moviename>
           xyz
    </moviename>
    <city>
           Hyd
    </city>
    <theatername>
           abc
    </theatername>
    <noofreels>
           16
     </noofreels>
     <aspectratio>
         216
     </aspectratio>
</Movies>

I want the values of tags servername and theatername. Rest I dont want. How to get these using java. Is it possible to get the value using tagnames.

Aucun commentaire:

Enregistrer un commentaire