3

I want a common Parser which parse any type of XMl response. At present I am using XmlPullParser.. in which I am passing xmlresponse from webservice and checking XmlPullParser.START_TAG and store data in the Beans Object accordingly..

for that I am creating one bean, one parser for each of the webservice I am parsing..

I've gone through one common parser over iOS App which input all the start tag as array to any webservice and storing data in key-value pair, and gives one object which contains all the data.. so no need of creating Bean and Parser separately..

0

1 Answer 1

9

Common class for XML is the nice idea. I have created a demo to make a common XML parser class.

To create a common class there can be many ways,It depends on your requirement. Some persons want to get the KeyValuePair like you are referencing in your question or some wants different ways.

I have create one XML parser class which will parse the xml file and will return object. This object can have multiple childs.

You can get the code from this blog.

Hope this will help everyone.

Sign up to request clarification or add additional context in comments.

2 Comments

Mind blowing efforts.. !! Thanks Dharmendra !
hi @Dharmendra , I am getting a blank exception while calling display(xmlObject); it gives blank values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.