1
我正在處理XML中的一個簡單字典,現在我正在嘗試輸出一些垂直字,但是它們全都出現在沒有空格的行上。垂直輸出XSL和XML
這是一些XML文件的
<thesaurus>
<dictionary>
<language>English</language>
<word type="1">word 1</word>
<word type="2">word 2</word>
<word type="3">word 3</word>
<word type="4">word 4</word>
<word type="5">word 5</word>
<word type="6">word 6</word>
</dictionary>
</thesaurus>
這是我的第一個 「差不多」 的解決方案
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="//word">
<xsl:sort order="ascending"/>
</xsl:apply-templates>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
這種解決方案只能打印出所有的字像這樣
AgentsColorFoundationsGrainPartialPogotypePretendSilentStrollTender
我的第二次嘗試是這樣
<xsl:for-each select="thesaurus">
<h1> <xsl:value-of select="//word"/></h1>
</xsl:for-each>
這樣一來,我可以樣式的話,他們會打印垂直,但事情是隻有第一個的話被打印。 =/
將是偉大的一個提示:)
感謝
它的工作就像一個魅力的..當然非常感謝:) – Dymond 2012-02-03 20:31:23
@FelipeOtarola,不客氣! – 2012-02-04 08:13:15