O'Reilly logo

jQuery Mobile Cookbook by Chetan K Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using XML content

You can display data obtained from various formats and sources in your application. This recipe shows you how to display a sample set of Student Records obtained from an XML file.

Getting ready

Copy the full code of this recipe from the code/04/xml-content sources folder. You can launch this code using the URL http://localhost:8080/04/xml-content/main.html.

How to do it...

  1. Create the student.xml file with the student node having attributes name and age. Each student node has multiple course child elements. Each course element has a name attribute and a child marks element as shown in the following code:
    <?xml version="1.0" encoding="utf-8" ?>
    <students>
      <student name="Alex" age="22"> <course name="HTML5"> <marks>89</marks> </course> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required