I want to transform a XML into a readable HTML. Below I am putting a sample part of my XML that I am unable to transform myself and needs some help.
The XML may have a variable number of columns that will be generated by the name col1,col2---colxxx. Here If ITEM=Label I am adding <B> before their names.
Sample XML is as follows
<Root>
<row ID="1" ITEM="Label" col1="visit no">
<row ID="1" ITEM="Data" col1="1">
<row ID="1" ITEM="Label" col1="Date">
<row ID="1" ITEM="Data" col1="8/11/2018">
<row ID="1" ITEM="Label" col1="PatName" col2="DocName" col3="DocName" />
<row ID="2" ITEM="Data" col1="Sam Hul" col2="Dr Mike" col3="Vegas Hospital"/>
<row ID="2" ITEM="Data" col1="Dan Brown" col2="Dr Matt" col3="California Hospital"/>
I want to convert the above XML into below HTML content. The col1,col2, col3 are being generated using a loop. so they will have names will have an incremental number after col.
The expected output HTML is
<Table>
<tr><td><b>visit no</b></td></tr>
<tr><td>1</td></tr>
<tr><td><b>Date</b></td></tr>
<tr><td>8/11/2018</td></tr>
<tr><td><b>PatName</b></td><td><b>DocName</b></td><td><b>DocName</b></td></tr>
<tr><td>Sam Hul</td><td>Dr Mike</td><td>Vegas Hospital</td></tr>
<tr><td>Dan Brown</td><td>Dr Matt</td><td>California Hospital</td></tr>
</table>
This is what i am trying at this moment.Buts its generating the single TR
<tr>
<xsl:for-each select="row/@*">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
</tr>
