I have an multiple entities (<data> in my example) with key-value pairs. Every entity contains the same keys in the same order, but I don’t know which and how many. How to transform this to a HTML table using XSLT, having the keys in the table headers and the values of the entities in the table rows?
<data>
<entry>
<key>id</key><value>12345</value>
</entry>
<entry>
<key>price</key><value>12.45</value>
</entry>
<entry>
<key>country</key><value>UK</value>
</entry>
<data>
<data>
<entry>
<key>id</key><value>67890</value>
</entry>
<entry>
<key>price</key><value>67.89</value>
</entry>
<entry>
<key>country</key><value>DE</value>
</entry>
<data>
… should become …
<tr><th>id</th><th>price</th><th>country</th></tr>
<tr><td>12345</td><td>12.45</td><td>UK</td></tr>
<tr><td>67890</td><td>67.89</td><td>DE</td></tr>
Use:
Output: