I am new in XSLT.I have an XML file and I want to use xslt to show the information in the xml file into a table. but I can the information in a row like this:
apfel 8.97 Fa. Krause Kirschen 10.45 Fa. Helbig apfel 12.67 Fa. Liebig
this is my XML file:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/First.xsl"?>
<lieferungen xmlns="urn:myspace:lieferungen"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:myspace:lieferungen ....">
<artikel id="3526">
<name>apfel</name>
<preis stueckpreis="true">8.97</preis>
<lieferant>Fa. Krause</lieferant>
</artikel>
<artikel id="7866">
<name>Kirschen</name>
<preis stueckpreis="false">10.45</preis>
<lieferant>Fa. Helbig</lieferant>
</artikel>
</lieferungen>
and here is my XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:template match="/">
<html>
<h1>The First XSLT in diesem Jahr</h1>
<table>
<tr>
<td>Name</td>
<td>Artikel</td>
<td>Preis</td>
<td>Liferant</td>
</tr>
<xsl:for-each select="artikel">
<tr>
<td>
<xsl:value-of select="name"/>
</td>
<td>
<xsl:value-of select="preis"/>
</td>
<td>
<xsl:value-of select="lieferant"/>
</td>
</tr>
</xsl:for-each>
</table>
</html>
</xsl:template>
</xsl:stylesheet>