Parse a custom XML file in LWUIT using KXML

JanethD

New Member
I'm creating an App using LWUIT and part of its functionality is as thus, I'm using KXML 2_2-3-0 to parse my Xml files. I'm parsing two files, an XML file(http://mobileplanner.netau.net/counties.xml) and an RSS feed. Lets forget about the feed for now. This is the structure of my XML file,(?xml version="....(the usual stuff).....)(kenya)(county)(name)Nairobi(/name)(population)Population: some figure(/population)(econ)Economy: Trade and Finance(/econ)(admin)Governor: None yet(/admin)(constituencies)Constituencies: Under Analysis(/constituencies)(desc)Overview: Some data(/desc)(irating)Rating: 8/10(/irating)(/county)//there are 46 more county nodes.(the brackets instead of tags are meant to prevent detection of tags as I post)(/kenya)I'd like to have a combo box with a list of all the 47 counties, items in the combo box list should be the texts between (name)(/name) tags. When a user selects an item in the combo box list, info for the selected item(in this case, county), is displayed. Example, from the above XML file, the combo box item should be Nairobi, when its selected, the following is displayed,Population: some figureEconomy: Trade and FinanceGovernor: None yetConstituencies: Under AnalysisOverview: Some dataRating: 6/10How do I do this? I've tried using getTitle and defining the nodes but the app connects to the file(via http) but displays nothing(not even error messages). If you need to view the xml file further, just request.
 
Back
Top