Я пытаюсь преобразовать xml-файл, используя xslt stylesheet в html-формат для печати значений. мои файлы .xml выглядит следующим образом:xml to html out using xslt stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type= "text/xsl" href="rt.xsl"?>
<entityset>
<entity id="32" name="RT: Testing : Testing" hidden="true">
<attribute id="1242" name="Tiketi receiver" code="start_supportGroup">
<value>3.Saldo</value>
</attribute>
<attribute id="682" name="Kohde" code="store">
<reference id="288799" name="Market"/>
</attribute>
<attribute id="683" name="Contact" code="person">
<value>[email protected]</value>
</attribute>
<attribute id="684" name="Puhelinnumero" code="phone">
<value>0505444566</value>
</attribute>
</entity>
<entity id="32" name="RT: Testing2 : Testing2" hidden="true">
<attribute id="1243" name="Tiketi receiver2" code="start_supportGroup">
<value>4.Saldo</value>
</attribute>
<attribute id="682" name="Kohde" code="store">
<reference id="288799" name="Market2"/>
</attribute>
<attribute id="683" name="Contact" code="person">
<value>[email protected]</value>
</attribute>
<attribute id="684" name="Puhelinnumero" code="phone">
<value>05054445663</value>
</attribute>
</entity>
</entityset>
И я хотел бы, чтобы распечатать элементы TD HTML для кода = «» часть в атрибуте. Что-то вроде этого:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="entity">
<html>
<body>
<h2>RKPP-TIKETIT</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ID</th>
<th style="text-align:left">Kohde</th>
<th style="text-align:left">StartSupportgroup</th>
</tr>
<xsl:for-each select="entity/attribute">
<tr>
<td><xsl:for-each select="attribute">
<xsl:attribute name="{@code}" >
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Привет я могу добиться этого, пожалуйста, совет.
EDIT: это то, что я хочу добиться:
start_supportgroup store phone
<td>3.Saldo</td> <td>Market</td> <td>505444566</td>
<td>4.Saldo</td> <td>Market2</td> <td>5054445663</td>
как изображение: http://www.imgrobot.com/image/wUQ
Спасибо,
Toby
У вас есть конкретный вопрос? –
Привет, да. Как распечатать, используя значения html таблицы td для атрибута 4.Saldo –
user2023042
Оригинальный вопрос, отредактированный с желаемым результатом – user2023042