how can I get only data for nested element in xml using simple xml android

lewissmiffy

New Member
I am hoping someone could help, and would really appreciate.I am trying to create elements from an xml using simple xml for android and I am not interested in the root, but only some nested elements. I wonder if there is a way for simple xml to get those elements without me creating all the classes starting from root(Response class in this case). I am only interested in getting the Stations class from the xml below. Thank you.\[code\] <Response xmlns="http://www.sss.com/ws/"> <GroupInfo> <Id>lirr</Id> <Name>Long Island Rail Road</Name> <VehicleTypes>R</VehicleTypes> <Category>NYC to LI Regional Rail</Category> <IconLarge> <Width>50</Width> <Height>50</Height> </IconLarge> <Icon> <Width>25</Width> <Height>25</Height> </Icon> <Stations> <Station> <Id>albertson</Id> <Name>Albertson</Name> <X>-73.64169</X> <Y>40.77205</Y> <Radius>100</Radius> </Station> <Station> <Id>yaphank</Id> <Name>Yaphank</Name> <X>-72.91588</X> <Y>40.8256</Y> <Radius>100</Radius> </Station> </Stations> </GroupInfo> <ResponseStatus> <ResultCode>200</ResultCode> <ResultString>Success.</ResultString> </ResponseStatus> </Response>\[/code\]
 
Back
Top