For example, you have the following list of students and the courses they are taking:
Student | Courses |
---|---|
Alyssa | French, English |
Ben | Latin, Science |
Cy | Latin, French |
This is the chart as shown in XML:
<?xml version="1.0" encoding="UTF-8"?> <school> <student name="Alyssa"> <course>French</course> <course>English</course> </student> <student name="Ben"> <course>Latin</course> <course>Science</course> </student> <student name="Cy"> <course>Latin</course> <course>French</course> </student> </school>
You decide that you would prefer to list all of the students in a particular course. To do so, you can divide students into groups based on the courses they take. The course name is the 'key':
Course | Student |
---|---|
French | Alyssa |
Latin | Ben, Cy |
English | Alyssa |
Science | Ben |
This is the chart as shown in XML:
<?xml version="1.0" encoding="UTF-8"?> <school> <course name="French"> <student name="Alyssa"/> <student name="Cy"/> </course> <course name="Latin"> <student name="Ben"/> <student name="Cy"/> </course> <course name="English"> <student name="Alyssa"/> </course> <course name="Science"> <student name="Ben"/> </course> </school>
The following instructions apply to the Resource perspective, but they will also work in many other perspectives.
To create a grouping, follow these steps: