Grouping elements

Grouping enables you to restructure data by splitting it into groups. The element or attribute that you choose as the base of your group is called the 'key'. 

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:

  1. Open your map file in the XML mapping editor.
  2. Map the source and target nodes as appropriate.
  3. Right-click the transform type box, and select Group.
  4. Right-click Group, and select Show in Properties. In the Properties view, select a key for grouping and click Add.
  5. To view group details, click the arrow at the top right of the Group type box.
  6. In the group details view, complete the mappings for all the nodes in the group.
  7. To return to the main map view, click the arrow at the top right of the group details page.
  8. Save your mapping.
Related concepts
XML mapping editor

Feedback