2012-03-21 3 views
0
)

다음 목록의 기사 목록에서 XSL을 사용하여 표를 출력하려고합니다. 요구는 반복 가득, 분할, 분할, 전체, 분할, 분할 등XSL 표 출력 (

<table> 
    <tr> 
     <td>Full</td> 
    </tr> 
    <tr> 
     <td>Split</td> 
     <td>Split</td> 
    </tr> 
    ... 
</table> 

그래서 1 매 등 기사는 전체 기사이지만, 나머지는 기사를 분할하고 행하고자합니다 하나만이 아니라 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-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&amp;N=165&amp;L=248&amp;F=H</link> 
     <description>&lt;P&gt;&lt;STRONG&gt;Until 4 September&lt;/STRONG&gt;&lt;BR&gt;Our school holiday activities are well under way and there are lots more to come.&amp;nbsp; Every week has a different theme and every day there’s a new creative craft activity to try.&amp;nbsp; And don’t forget there's crabbing every day from our pontoon.&lt;/P&gt;</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&amp;N=165&amp;L=248&amp;F=H</link> 
     <description>&lt;P&gt;&lt;STRONG&gt;Every Thursday until 1 September&lt;/STRONG&gt;&lt;BR&gt;Our Story Explorer will take you on a magical journey around the Museum to discover weird and wonderful tales from across the world.&amp;nbsp; Look out for pirates, polar bears and Packet ships throughout the summer.&lt;/P&gt;</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&amp;N=165&amp;L=343&amp;F=H</link> 
     <description>&lt;P&gt;&lt;STRONG&gt;7 August&lt;/STRONG&gt;&lt;BR&gt;Cheer on local pilot gig crews racing from St Anthony's Head to the Maritime Museum.&amp;nbsp; Watch on land from Events Square or get a ticket for the spectator boat to have a close up view on the water.&lt;/P&gt;</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&amp;N=165&amp;L=248&amp;F=H</link> 
     <description>&lt;P&gt;&lt;STRONG&gt;Until 4 September&lt;/STRONG&gt;&lt;BR&gt;Our school holiday activities are well under way and there are lots more to come.&amp;nbsp; Every week has a different theme and every day there’s a new creative craft activity to try.&amp;nbsp; And don’t forget there's crabbing every day from our pontoon.&lt;/P&gt;</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&amp;N=165&amp;L=248&amp;F=H</link> 
     <description>&lt;P&gt;&lt;STRONG&gt;Every Thursday until 1 September&lt;/STRONG&gt;&lt;BR&gt;Our Story Explorer will take you on a magical journey around the Museum to discover weird and wonderful tales from across the world.&amp;nbsp; Look out for pirates, polar bears and Packet ships throughout the summer.&lt;/P&gt;</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&amp;N=165&amp;L=343&amp;F=H</link> 
     <description>&lt;P&gt;&lt;STRONG&gt;7 August&lt;/STRONG&gt;&lt;BR&gt;Cheer on local pilot gig crews racing from St Anthony's Head to the Maritime Museum.&amp;nbsp; Watch on land from Events Square or get a ticket for the spectator boat to have a close up view on the water.&lt;/P&gt;</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> 
+2

은 누군가가 당신을 도와 거의 불가능할 것 입력 XML을 보지 않고 : 여기에 내가 의도 한 결과로 추정거야. [faq]와 [ask]를 읽어주십시오. –

+0

upvote를 보완하기 위해 downvoting입니다. 질문에 입력 XML이 없으므로 대답 할 수 없습니다. – MiMo

+0

XML을 추가했습니다. 죄송합니다. –

답변