Hi all,
Firstly, i'm a complete beginner so please bear with me.
Here is an example of what i need to do. Say this is my XML file:
<person>
<name>John</name>
<person>
<cars>
<car>
<make>BMW</make>
</car>
<car>
<make>Mercedes</make>
</car>
<car>
<make>Ford</make>
</car>
<car>
<make> BMW </make>
</car>
<car>
<make> BMW </make>
</car>
</cars>
In the XSLT file i have to work with, it displays a person and their cars (based on a relationship in the underlying database). If the person has more than one BMW, it displays duplicate records depending on how many BMWs they have. What i want is ONE row for each person and instead of listing the car "make" i want the number of cars with that make, so i assume a calculation using count? So a typical record in my results would be:
Person: John
Number of BMWs: 3
Number of Mercedes: 1
Number of Ford: 1
So the question is, a) how to limit my results to one record
for john and b) displaying a count for each "make" of car.
I hope this is clear - i made up an example because my real data is too complicated.
I hope you can help!
Thanks
Divinyl
Firstly, i'm a complete beginner so please bear with me.
Here is an example of what i need to do. Say this is my XML file:
<person>
<name>John</name>
<person>
<cars>
<car>
<make>BMW</make>
</car>
<car>
<make>Mercedes</make>
</car>
<car>
<make>Ford</make>
</car>
<car>
<make> BMW </make>
</car>
<car>
<make> BMW </make>
</car>
</cars>
In the XSLT file i have to work with, it displays a person and their cars (based on a relationship in the underlying database). If the person has more than one BMW, it displays duplicate records depending on how many BMWs they have. What i want is ONE row for each person and instead of listing the car "make" i want the number of cars with that make, so i assume a calculation using count? So a typical record in my results would be:
Person: John
Number of BMWs: 3
Number of Mercedes: 1
Number of Ford: 1
So the question is, a) how to limit my results to one record
for john and b) displaying a count for each "make" of car.
I hope this is clear - i made up an example because my real data is too complicated.
I hope you can help!
Thanks
Divinyl