Udskrive i 2 rækker
Hej eJeg har en xsl fil som udskriver min xml som html.
Det den gør følgende.
Nummer 1 i liste bliver udskrevet forskelligt fra alle de andre. Virker find.
Alle de andre bliver udskrevet under hinanden, men jeg vil gerne have den til at udskrive den i 2 rækker.
Som der er nu ser det sådanne ud.
1
2
3
4
5
Og jeg vil gerne have den til dette:
1
2 3
4 5
Håber det giver mening.
Min test kode er her.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="catalog/cd">
<xsl:choose>
<xsl:when test="position() = 1">
<table class="style1">
<tr>
<td rowspan="3" width="80" valign="top" bgcolor="#ff00ff">
billede"
</td>
<td>
<xsl:value-of select="title"/>
</td>
</tr>
<tr>
<td>
<xsl:value-of select="artist"/>
Dato Email
</td>
</tr>
<tr>
<td>
View full blog article
</td>
</tr>
</table>
<xsl:value-of select="artist"/>
</xsl:when>
<xsl:otherwise>
<table class="style1">
<tr>
<td rowspan="3" width="80" valign="top">
billede
</td>
<td>
<xsl:value-of select="title"/>
</td>
</tr>
<tr>
<td>
<xsl:value-of select="artist"/>
Dato Email
</td>
</tr>
<tr>
<td>
View full blog article
</td>
</tr>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Xml’en er her (også test)
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
</catalog>
