I have the ff. XML from a URL:
You only have one ParsedExampleDataSet object in your handler, so there's only room to store one entry. Change ExampleHandler to have an ArrayList
and also a ParsedExampleDataSet currentSet
. Inside startElement
, when you see the PhoneBook
tag, set currentSet
to a new instance of ParsedExampleDataSet
and add it to results
. After parsing, results
should contain everything you want.