한번에 2 위치를 나누어 나머지가 있는지보고 ...
XML 입력
<items>
<item>
<name>A</name>
</item>
<item>
<name>B</name>
</item>
<item>
<name>C</name>
</item>
<item>
<name>D</name>
</item>
<item>
<name>E</name>
</item>
<item>
<name>F</name>
</item>
<item>
<name>G</name>
</item>
</items>
XSLT 1.0
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/*">
<html>
<table>
<xsl:apply-templates select="item[position() mod 2 = 1]"/>
</table>
</html>
</xsl:template>
<xsl:template match="item[position() mod 2 = 1]">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="following-sibling::item[1]/name"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
HTML 출력
<html>
<table>
<tr>
<td>A</td>
<td>B</td>
</tr>
<tr>
<td>C</td>
<td>D</td>
</tr>
<tr>
<td>E</td>
<td>F</td>
</tr>
<tr>
<td>G</td>
<td></td>
</tr>
</table>
</html>
이 데이터를 두 개의 열로보고 싶습니다. – ROOMY
정확하지 않습니다. HTML 출력? 어떻게 열이 어떻게 생겼을까요? –
LIKE