In my application, I am getting an XML response from my server while calling webservice. The the response looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">{"rows":[{"noteId" : "1", "procedure" : "D0140", "teeth": "", "encounterno": "123456" , "WorkflowCode": "Submitted", "datecreated": "10/27/2011", "surf": "", "description": "Limited Oral Evaluation-Problem Focused","status": "Existing","prefdate": "10/27/2011 05:06" }, {"noteId" : "2", "procedure" : "D0140", "teeth": "", "encounterno": "123456" , "WorkflowCode": "Submitted", "datecreated": "11/07/2011", "surf": "", "description": "Limited Oral Evaluation-Problem Focused","status": "Completed","prefdate": "01/01/2011 05:08" },{"noteId" : "3", "procedure" : "D0140", "teeth": "", "encounterno": "123456" , "WorkflowCode": "Submitted", "datecreated": "04/01/2011", "surf": "", "description": "Limited Oral Evaluation-Problem Focused","status": "Completed","prefdate": "02/01/2011 05:08" },{"noteId" : "4", "procedure" : "D0140", "teeth": "", "encounterno": "123456" , "WorkflowCode": "Submitted", "datecreated": "01/10/2011", "surf": "", "description": "Limited Oral Evaluation-Problem Focused","status": "Completed","prefdate": "01/01/2011 05:08" },{"noteId" : "5", "procedure" : "D0140", "teeth": "", "encounterno": "123456" , "WorkflowCode": "Submitted", "datecreated": "01/27/2011", "surf": "", "description": "Limited Oral Evaluation-Problem Focused","status": "Completed","prefdate": "10/05/2011 05:08" }]}</string>
I want to parse this string using jQuery Mobile and content will be displayed in jQuery Mobile list view.
How can I parse this response?
I think this is what you’re looking for
http://api.jquery.com/jQuery.parseXML/
Once you’ve the parsed object you can create a list (ul or ol).
Then call
$(listItem).listview('refresh')each time you add a list item element.
Hope this helps.