0
我想從以下格式的文章列表中使用XSL輸出表格。要重複的需要,所以滿,分割,分割,豐滿,拆分,拆分等XSL表格輸出與國防部
<table>
<tr>
<td>Full</td>
</tr>
<tr>
<td>Split</td>
<td>Split</td>
</tr>
...
</table>
所以第一次和每一個所述的物品,是一個完整的文章,但其餘的被分割文章,該行會包含2個td,不只是一個。
如果我這樣做是PHP或類似的,我會根據需要有條件地添加打開和關閉tr。看來我不能在XSL中這樣做。所以我不認爲我可以在tr上使用xsl:if。
<xsl:choose>
<xsl:when test="position() mod 4 = 0 or position() = 1">
<tr>
<td>Full</td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr>
<td>Split</td>
</tr>
</xsl:otherwise>
</xsl:choose>
任何人都可以指向正確的方向嗎?
非常感謝
編輯這裏是XML
<?xml-stylesheet type="text/xsl" href="template.xsl" version="1.0"?>
<rss version="2.0">
<channel>
<title>August 2011</title>
<link>http://newsletters.falmouth.ac.uk/829a80a6-d28f-4f69-88e7-6177391b7eba/issue.aspx</link>
<publication>Alumni e-Newsletter</publication>
<publicationDescription>Alumni e-Newsletter</publicationDescription>
<description>The school holidays are upon us and one thing that’s guaranteed is that the weather will be as unpredictable as ever! But fear not, the Maritime Museum has the perfect solution for keeping the kids entertained come rain or shine.</description>
<language>en-gb</language>
<category>Alumni e-Newsletter</category>
<generator />
<lastBuildDate>Thu, 26 Jan 2012 14:03:46 GMT</lastBuildDate>
<copyright>Copyright: (C) University College Falmouth</copyright>
<ttl>15</ttl>
<image>
<title>This is a caption</title>
<url>http://newsletters.falmouth.ac.uk/uploads/59026aae-27f8-4682-987f-632f1b4b6f77.jpg</url>
</image>
<item id="785">
<title>Summer Holiday Activities 001</title>
<link>http://www.nmmc.co.uk/newsletter/link.php?M=10940&N=165&L=248&F=H</link>
<description><P><STRONG>Until 4 September</STRONG><BR>Our school holiday activities are well under way and there are lots more to come.&nbsp; Every week has a different theme and every day there’s a new creative craft activity to try.&nbsp; And don’t forget there's crabbing every day from our pontoon.</P></description>
<image>
<title>August 2011</title>
<description>Summer Holiday Activities</description>
<caption />
<url>http://newsletters.falmouth.ac.uk/uploads/22c0a56b-f372-4569-ae8c-9e0b475115f8.jpg</url>
<width>190</width>
<height>100</height>
</image>
<pubDate>Tue, 16 Aug 2011 14:39:54 GMT</pubDate>
</item>
<item id="779">
<title>Douglas Dapper - The Story Explorer 002</title>
<link>http://www.nmmc.co.uk/newsletter/link.php?M=10940&N=165&L=248&F=H</link>
<description><P><STRONG>Every Thursday until 1 September</STRONG><BR>Our Story Explorer will take you on a magical journey around the Museum to discover weird and wonderful tales from across the world.&nbsp; Look out for pirates, polar bears and Packet ships throughout the summer.</P></description>
<image>
<title>August 2011</title>
<description>Douglas Dapper - The Story Explorer</description>
<caption />
<url>http://newsletters.falmouth.ac.uk/uploads/ab01dbdf-d671-4127-9b9d-9aa6878bd97b.jpg</url>
<width>190</width>
<height>100</height>
</image>
<pubDate>Tue, 16 Aug 2011 10:58:12 GMT</pubDate>
</item>
<item id="780">
<title>Two Castles Gig Race 003</title>
<link>http://www.nmmc.co.uk/newsletter/link.php?M=10940&N=165&L=343&F=H</link>
<description><P><STRONG>7 August</STRONG><BR>Cheer on local pilot gig crews racing from St Anthony's Head to the Maritime Museum.&nbsp; Watch on land from Events Square or get a ticket for the spectator boat to have a close up view on the water.</P></description>
<image>
<title>August 2011</title>
<description>Two Castles Gig Race</description>
<caption />
<url>http://newsletters.falmouth.ac.uk/uploads/f0fe2730-a51f-4653-98d0-499ae8627635.jpg</url>
<width>190</width>
<height>100</height>
</image>
<pubDate>Tue, 16 Aug 2011 10:58:17 GMT</pubDate>
</item>
<item id="785">
<title>Summer Holiday Activities 001</title>
<link>http://www.nmmc.co.uk/newsletter/link.php?M=10940&N=165&L=248&F=H</link>
<description><P><STRONG>Until 4 September</STRONG><BR>Our school holiday activities are well under way and there are lots more to come.&nbsp; Every week has a different theme and every day there’s a new creative craft activity to try.&nbsp; And don’t forget there's crabbing every day from our pontoon.</P></description>
<image>
<title>August 2011</title>
<description>Summer Holiday Activities</description>
<caption />
<url>http://newsletters.falmouth.ac.uk/uploads/22c0a56b-f372-4569-ae8c-9e0b475115f8.jpg</url>
<width>190</width>
<height>100</height>
</image>
<pubDate>Tue, 16 Aug 2011 14:39:54 GMT</pubDate>
</item>
<item id="779">
<title>Douglas Dapper - The Story Explorer 002</title>
<link>http://www.nmmc.co.uk/newsletter/link.php?M=10940&N=165&L=248&F=H</link>
<description><P><STRONG>Every Thursday until 1 September</STRONG><BR>Our Story Explorer will take you on a magical journey around the Museum to discover weird and wonderful tales from across the world.&nbsp; Look out for pirates, polar bears and Packet ships throughout the summer.</P></description>
<image>
<title>August 2011</title>
<description>Douglas Dapper - The Story Explorer</description>
<caption />
<url>http://newsletters.falmouth.ac.uk/uploads/ab01dbdf-d671-4127-9b9d-9aa6878bd97b.jpg</url>
<width>190</width>
<height>100</height>
</image>
<pubDate>Tue, 16 Aug 2011 10:58:12 GMT</pubDate>
</item>
<item id="780">
<title>Two Castles Gig Race 003</title>
<link>http://www.nmmc.co.uk/newsletter/link.php?M=10940&N=165&L=343&F=H</link>
<description><P><STRONG>7 August</STRONG><BR>Cheer on local pilot gig crews racing from St Anthony's Head to the Maritime Museum.&nbsp; Watch on land from Events Square or get a ticket for the spectator boat to have a close up view on the water.</P></description>
<image>
<title>August 2011</title>
<description>Two Castles Gig Race</description>
<caption />
<url>http://newsletters.falmouth.ac.uk/uploads/f0fe2730-a51f-4653-98d0-499ae8627635.jpg</url>
<width>190</width>
<height>100</height>
</image>
<pubDate>Tue, 16 Aug 2011 10:58:17 GMT</pubDate>
</item>
</channel>
</rss>
沒有看到輸入XML這將是幾乎不可能對任何人來幫助你。請閱讀[常見問題]和[問] – 2012-03-21 07:54:10
我是downvoting以補償upvote - 該問題沒有輸入XML,因此無法回答。 – MiMo 2012-03-21 17:12:02
添加了XML,很抱歉。 – 2012-03-22 09:13:45