Count how many nodes have the same value of a child node (wi
Posted: Sat Nov 30, 2013 10:58 pm
Hello,
I'd like to Count how many nodes have the same value of a child node and display the list(with xslt using variables)
The xml is smth like this:
I want to count how many students are at every major and display the list, so smth like this:
Chemistry - 3
Student1
Student2
Student4
Engineering - 1
Student3
...
I'd like to Count how many nodes have the same value of a child node and display the list(with xslt using variables)
The xml is smth like this:
Code: Select all
<list>
<student>
<name>Student1</name>
<major>Chemistry</major>
<email>st1@example.com</email>
</student>
<student>
<name>Student2</name>
<major>Chemistry</major>
<email>st2@example.com</email>
</student>
<student>
<name>Student3</name>
<major>Engineering</major>
<email>st3@example.com</email>
</student>
<student>
<name>Student4</name>
<major>Chemistry</major>
<email>st4@example.com</email>
</student>
</list>
Chemistry - 3
Student1
Student2
Student4
Engineering - 1
Student3
...