Witam, mój pierwszy post i początki z xml. Mam pliczek xml, który chce wyświetlić w tabeli:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="lab73.xsl" ?>
<DATA>
<PERSON ID="1">
<NAME>stefania</NAME>
</PERSON>
<WYNIK ID="1">
<POINT>0</POINT>
</WYNIK>
<PERSON ID="2">
<NAME>zdzichu</NAME>
</PERSON>
<WYNIK ID="2">
<POINT>1</POINT>
</WYNIK>
</DATA>
oraz plik arkusza stylów xsl:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head>
<title>lab73</title>
</head>
<body>
<table border="1">
<tr bgcolor="yellow">
<th align="left">GRACZ</th> <th align="left">WYNIK</th>
</tr>
<xsl:for-each select="DATA/PERSON">
<tr>
<td><xsl:value-of select="NAME"/></td>
<td>
<xsl:for-each select="DATA/WYNIK">
<xsl:value-of select="POINT"/> <BR/>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
oczywiście nie działa, bo koncepcja jest zła. Trzeba po atrybucie ID pewnie zrobić pętle, ale ja nie wiem kompletnie jak.. Pomoże ktoś?