Some xslt help anyone?

C

Chris Kettenbach

Good Morning,
I have an xml file that's generated from a database. How do I select
distinct values from a field in xslt and then loop through the records and
produce output. Example

<registrations>
<registration>
<company>Awesome Printers</company>
<first>John</first>
<last>Smith</last>
</registration>
<registration>
<company>Awesome Printers</company>
<first>Bob</first>
<last>Roberts</last>
</registration>
<registration>
<company>Awesome Printers</company>
<first>John</first>
<last>Johnson</last>
</registration>
<registration>
<company>Other Company</company>
<first>Tom</first>
<last>Thomas</last>
</registration>
<registration>
<company>Other Company</company>
<first>Dan</first>
<last>Daniels</last>
</registration>
</registrations>
++++++++++++++++++++++++++++++++++++++++++++++++
I want the out put to be something like this

<table>
<tr>
<td>Company Name</td>
<td>Employees</td>
</tr>
<tr>
<td>Awesome Printers</td>
<td>John Smith<br/>
Bob Roberts<br/>
John Johnson<br/></td>
</tr>
<tr>
<td>Other Company</td>
<td>Tom Thomas<br/>
Dan Daniels<br/></td>
</tr>
</table>

Effectively writing unique company names once and then putting only the
employees from that company into the employee table cell.

Thanks for any advise.
Regards,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top