Ahoj, pomohl by mi prosím někdo s transformací následujícího xml souboru do html tabulky?
Narazil jsem na problém u table/elem kdy to dokážu vypsat jako řádku, ale potřeboval bych to vypsat takto:
<tr>
<td>cvss:</td><td>5.8</td>
<td>type:</td><td>exploitpack</td>
....
</tr>
<host starttime="1613406192" endtime="1613406215"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="10.0.0.1" addrtype="ipv4"/>
<hostnames>
</hostnames>
<ports><extraports state="filtered" count="996">
<extrareasons reason="no-responses" count="972"/>
<extrareasons reason="host-prohibiteds" count="24"/>
</extraports>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="61"/><service name="ssh" product="OpenSSH" version="7.4" extrainfo="protocol 2.0" method="probed" conf="10"><cpe>cpe:/a:openbsd:openssh:7.4</cpe></service><script id="vulners" output="
 cpe:/a:openbsd:openssh:7.4: 
 	EXPLOITPACK:98FE96309F9524B8C84C508837551A19	5.8	https://vulners.com/exploitpack/EXPLOITPACK:98FE96309F9524B8C84C508837551A19	*EXPLOIT*
 	EXPLOITPACK:5330EA02EBDE345BFC9D6DDDD97F9E97	5.8	https://vulners.com/exploitpack/EXPLOITPACK:5330EA02EBDE345BFC9D6DDDD97F9E97	*EXPLOIT*
 	EDB-ID:46516	5.8	https://vulners.com/exploitdb/EDB-ID:46516	*EXPLOIT*
 	CVE-2019-6111	5.8	https://vulners.com/cve/CVE-2019-6111
 	SSH_ENUM	5.0	https://vulners.com/canvas/SSH_ENUM	*EXPLOIT*
 	PACKETSTORM:150621	5.0	https://vulners.com/packetstorm/PACKETSTORM:150621	*EXPLOIT*
 	MSF:AUXILIARY/SCANNER/SSH/SSH_ENUMUSERS	5.0	https://vulners.com/metasploit/MSF:AUXILIARY/SCANNER/SSH/SSH_ENUMUSERS	*EXPLOIT*
 	EXPLOITPACK:F957D7E8A0CC1E23C3C649B764E13FB0	5.0	https://vulners.com/exploitpack/EXPLOITPACK:F957D7E8A0CC1E23C3C649B764E13FB0	*EXPLOIT*
 	EXPLOITPACK:EBDBC5685E3276D648B4D14B75563283	5.0	https://vulners.com/exploitpack/EXPLOITPACK:EBDBC5685E3276D648B4D14B75563283	*EXPLOIT*
 	EDB-ID:45939	5.0	https://vulners.com/exploitdb/EDB-ID:45939	*EXPLOIT*
 	CVE-2018-15919	5.0	https://vulners.com/cve/CVE-2018-15919
 	CVE-2018-15473	5.0	https://vulners.com/cve/CVE-2018-15473
 	CVE-2017-15906	5.0	https://vulners.com/cve/CVE-2017-15906
 	1337DAY-ID-31730	5.0	https://vulners.com/zdt/1337DAY-ID-31730	*EXPLOIT*
 	EDB-ID:45233	4.6	https://vulners.com/exploitdb/EDB-ID:45233	*EXPLOIT*
 	CVE-2020-14145	4.3	https://vulners.com/cve/CVE-2020-14145
 	CVE-2019-6110	4.0	https://vulners.com/cve/CVE-2019-6110
 	CVE-2019-6109	4.0	https://vulners.com/cve/CVE-2019-6109
 	CVE-2018-20685	2.6	https://vulners.com/cve/CVE-2018-20685
 	PACKETSTORM:151227	0.0	https://vulners.com/packetstorm/PACKETSTORM:151227	*EXPLOIT*
 	EDB-ID:46193	0.0	https://vulners.com/exploitdb/EDB-ID:46193	*EXPLOIT*
 	1337DAY-ID-32009	0.0	https://vulners.com/zdt/1337DAY-ID-32009	*EXPLOIT*
 	1337DAY-ID-30937	0.0	https://vulners.com/zdt/1337DAY-ID-30937	*EXPLOIT*"><table key="cpe:/a:openbsd:openssh:7.4">
<table>
<elem key="cvss">5.8</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:98FE96309F9524B8C84C508837551A19</elem>
</table>
<table>
<elem key="cvss">5.8</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:5330EA02EBDE345BFC9D6DDDD97F9E97</elem>
</table>
<table>
<elem key="cvss">5.8</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:46516</elem>
</table>
<table>
<elem key="cvss">5.8</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2019-6111</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">canvas</elem>
<elem key="is_exploit">true</elem>
<elem key="id">SSH_ENUM</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">packetstorm</elem>
<elem key="is_exploit">true</elem>
<elem key="id">PACKETSTORM:150621</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">metasploit</elem>
<elem key="is_exploit">true</elem>
<elem key="id">MSF:AUXILIARY/SCANNER/SSH/SSH_ENUMUSERS</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:F957D7E8A0CC1E23C3C649B764E13FB0</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">exploitpack</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EXPLOITPACK:EBDBC5685E3276D648B4D14B75563283</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:45939</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2018-15919</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2018-15473</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2017-15906</elem>
</table>
<table>
<elem key="cvss">5.0</elem>
<elem key="type">zdt</elem>
<elem key="is_exploit">true</elem>
<elem key="id">1337DAY-ID-31730</elem>
</table>
<table>
<elem key="cvss">4.6</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:45233</elem>
</table>
<table>
<elem key="cvss">4.3</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2020-14145</elem>
</table>
<table>
<elem key="cvss">4.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2019-6110</elem>
</table>
<table>
<elem key="cvss">4.0</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2019-6109</elem>
</table>
<table>
<elem key="cvss">2.6</elem>
<elem key="type">cve</elem>
<elem key="is_exploit">false</elem>
<elem key="id">CVE-2018-20685</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">packetstorm</elem>
<elem key="is_exploit">true</elem>
<elem key="id">PACKETSTORM:151227</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">exploitdb</elem>
<elem key="is_exploit">true</elem>
<elem key="id">EDB-ID:46193</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">zdt</elem>
<elem key="is_exploit">true</elem>
<elem key="id">1337DAY-ID-32009</elem>
</table>
<table>
<elem key="cvss">0.0</elem>
<elem key="type">zdt</elem>
<elem key="is_exploit">true</elem>
<elem key="id">1337DAY-ID-30937</elem>
</table>
</table>
</script></port>
<port protocol="tcp" portid="80"><state state="closed" reason="reset" reason_ttl="61"/><service name="http" method="table" conf="3"/></port>
<port protocol="tcp" portid="113"><state state="closed" reason="reset" reason_ttl="64"/><service name="ident" method="table" conf="3"/></port>
<port protocol="tcp" portid="443"><state state="closed" reason="reset" reason_ttl="61"/><service name="https" method="table" conf="3"/></port>
</ports>
<times srtt="1578" rttvar="246" to="100000"/>
</host>
<xsl:template match="/">
<xsl:for-each select="host">
<tr>
<td><xsl:value-of select="address/@addr"/></td>
<td><xsl:value-of select="address/@addrtype"/></td>
<td><xsl:value-of select="@starttime"/></td>
<td><xsl:value-of select="@endtime"/></td>
<td><xsl:value-of select="ports/port/@protocol"/></td>
<td><xsl:value-of select="ports/port/@portid"/></td>
<td><xsl:value-of select="ports/port/state/@state"/></td>
<td><xsl:value-of select="ports/port/state/@reason"/></td>
<td><xsl:value-of select="ports/port/state/@reason_ttl"/></td>
<td><xsl:value-of select="ports/port/service/@name"/></td>
<td><xsl:value-of select="ports/port/service/@method"/></td>
<td><xsl:value-of select="ports/port/service/@conf"/></td>
<td><xsl:value-of select="ports/port/service/cpe"/></td>
<td><xsl:value-of select="ports/port/script/@id"/></td>
<xsl:for-each select="ports/port/script/table/elem">
<td><xsl:value-of select="@key"/></td>
</xsl:for-each>
<td><xsl:value-of select="ports/port/script/@output"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>