我們有一個顯示大量文本的XML文檔。該文本被包裝在-p標籤內,並且所有內容都被包裹在名爲-avsnitt-的標籤內。但是,每個-avsnitt-中只會顯示第一個-p標籤。
XML代碼:
<seksjon>
<p>3.1. Introduction</p>
<avsnitt>
<p>SIMULA is a general purpose programming language. It inherits the algorithmic properties of ALGOL 60 and introduces methods for structuring data. The main characteristic of SIMULA is that it is easily modelled towards specialized problem areas, and hence can be used as a basis for Special Application Languages.</p>
<p>In this Standard the name SIMULA is considered synonymous with SIMULA 67. Although there exists a predecessor, SIMULA I, this latter language has achieved limited use. It is recommended that the language defined in this Standard be referred to as "Standard SIMULA".</p>
<p>SIMULA includes most of the ALGOL 60 language. Wherever ALGOL is used in this Standard it relates to the STANDARD ALGOL 60 definition (ISO 1538).</p>
</avsnitt>
</seksjon>
XSL代碼:
<xsl:for-each select="kapittel/seksjon">
<h2><xsl:value-of select="p"/></h2>
<br></br>
<xsl:value-of select="avsnitt/p"/>
</xsl:for-each>
謝謝您更換
<xsl:value-of
!奇蹟般有效! – BTB