Showing posts with label xml change html dynamically thru xsl. Show all posts
Showing posts with label xml change html dynamically thru xsl. Show all posts

change html dynamically thru xsl

Wednesday, November 4, 2015

I have the following html.



<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
}
</style>
</head>
<body>

<table style="width:100%">
<tr>
<th>Name</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
</tr>
<tr>
<td> [lastName],[firstName] </td>
<td>[City]</td>
<td>[State]</td>
<td>[Zip]</td>
</tr>
</table>

</body>
</html>


I will get the values from an xml



<person>
<lastName>Zones</lastName>
<firstName>Adam</firstName>
<City>Columbus</City>
<State>OH</State>
<Zip>44250</Zip>
</person>


I want to replace the values in the table data elements dynamically as



<td>Zones, Adam</td>
<td>columbus</td>
<td>OH</td>
<td>44250</td>


How to achieve this. Need to change the name,city,state,zip with user entries.