问题:
我们有一个显示大量文本的 XML 文档。此文本包含在 -p-tags 中,所有内容都包含在名为 -avsnitt- 的标签中。但是,只会显示每个 -avsnitt- 中的第一个 -p-tag。
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>