Latest web development tutorials

XSLT <XSL : 정렬> 요소

<XSL : 정렬> 요소는 정렬 할 수있는 결과를 출력하는 데 사용됩니다.


주문 정보를 어디에 배치

단순히 XSL 파일에서 출력 결과를 정렬하려면의 <xsl : for-each> <: 정렬 XSL> 요소 요소는 내부에 추가됩니다

<?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>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<xsl:sort select="artist"/>
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

»시도

참고 : 선택속성은 정렬 할 수있는 XML 요소를 나타냅니다.