erikabuffalo
New Member
I developed a java based command line utility that transform an xml into another xml file and generate HTML. In this program I used SAX parser to read the content of source xml into my java object then use JAXB to generate the XML. Right now I'm creating the HTMl file by populating a string for HTML content but it results in hardcoded html codes inside my java class. Based on my research I can do XML to HTML conversion using XSLT. I am new to XSLT. Can anyone help me? Please see samples below. ThanksXML input:\[code\]<Groups> <Group> <GroupName>GroupA</GroupName> <Role> <RoleName>Correspondence Team B</RoleName> <Functions> <Function>CT2 Work</Function> <Function>HOL01_My Work</Function> <Function>HOL02_My Work</Function> </Functions> </Role></Group> <GroupName>GroupB</GroupName> <Role> <RoleName>Customer Service Rep</RoleName> <Functions> <Function>CSR Work</Function> <Function>HOL01_My Work</Function> </Functions> </Role></Group><Group> <GroupName>GroupB</GroupName> <Role> <RoleName>Dispute Advisor</RoleName> <Functions> <Function>DA Work</Function> <Function>HOL01_My Work</Function> </Functions> </Role></Group><Group> <GroupName>GroupA</GroupName> <Role> <RoleName>Correspondence Team</RoleName> <Functions> <Function>CT Work</Function> <Function>HOL01_My Work</Function> </Functions> </Role></Group><Group> <GroupName>GroupB</GroupName> <Role> <RoleName>Correspondence Team B</RoleName> <Functions> <Function>CT2 Work</Function> <Function>HOL01_My Work</Function> <Function>HOL02_My Work</Function> </Functions> </Role></Group>\[/code\]Desired Html table format:\[code\]<table border=1> <tr> <th>Group Name</th> <th>Role Name</th> <th>Function Names</th> </tr> <tr> <td rowspan=5>Group A</td> <td rowspan=2>Correspondence Team</td> <td>CT Work</td> </tr> <tr> <td>HOL01_My Work</td> </tr> <tr> <td rowspan=3>Correspondence Team B</td> <td>CT Work</td> </tr> <tr> <td>HOL01_My Work</td> </tr> <tr> <td>HOL01_My Work</td> </tr> <tr> <td rowspan=0>Group B</td> <td rowspan=2>Customer Service Rep</td> <td>CSR Work</td> </tr> <tr> <td>HOL01_My Work</td> </tr> <tr> <td rowspan=2>Dispute Advisor</td> <td>DA Work</td> </tr> <tr> <td>HOL01_My Work</td> </tr> <tr> <td rowspan=2>Correspondence Team</td> <td>CT Work</td> </tr> <tr> <td>HOL01_My Work</td> </tr></table>\[/code\]