XSL中實現(xiàn)HTML的表格自動換行_Xml教程
推薦:如何利用XMLHTTP無刷新獲取數(shù)據(jù)利用XMLHTTP無刷新獲取數(shù)據(jù). 客戶端和服務(wù)器端數(shù)據(jù)的交互有幾種方法. 1.提交,通過form/form提交到服務(wù)器端.也稱有刷新吧. 2.通過XMLHTTP無刷新提交到服務(wù)器端,并返回數(shù)據(jù).也稱無刷新吧. 利用XMLHTTP我們可以實現(xiàn)很多很強大的應(yīng)用.這文章主要介紹它的一
xml數(shù)據(jù)如:
<root>
<movie>1</movie>
<movie>2</movie>
<movie>3</movie>
<movie>4</movie>
<movie>5</movie>
<movie>6</movie>
<movie>7</movie>
<movie>8</movie>
<movie>9</movie>
<movie>10</movie>
<movie>11</movie>
<movie>12</movie>
</root>
要達到的效果:
1 2 3 4 5
6 7 8 9 10
11 12
XSL代碼:
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="Rows">5</xsl:variable>
<xsl:template match="//root">
<table>
<xsl:for-each select="movie[position() mod Rows=1]">
<tr>
<xsl:apply-templates select=".|following-sibling::*[position()<Rows]"/>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="movie">
<td>
<xsl:value-of select="."/>
</td>
</xsl:template>
</xsl:stylesheet>
分享:利用XMLHTTP無刷新自動實時更新數(shù)據(jù)前些時間寫了幾篇關(guān)于XMLHTTP運用的實例. (可以到http://dev.csdn.net/user/wanghr100看之前的幾編關(guān)于XMLHTTP的介紹.) 近來看論壇上經(jīng)常有人提問關(guān)于如何無刷新,自動更新數(shù)據(jù). 傳統(tǒng)上,我們?yōu)g覽網(wǎng)頁,如果加入最新的數(shù)據(jù).只能是等我們重新向服務(wù)器端請求時才
- 相關(guān)鏈接:
- 教程說明:
Xml教程-XSL中實現(xiàn)HTML的表格自動換行
。