変換する xml データの次の構造があります。
<chapter>
<title>Text</title>
<subtitle>Text</subtitle>
<paragraph>Text</paragraph>
<paragraph>Text</paragraph>
<subtitle>Text</subtitle>
<paragraph>Text</paragraph>
<other>Text</other>
</chapter>
<chapter>
<title>Text</title>
<paragraph>Text</paragraph>
<paragraph>Text</paragraph>
<paragraph>Text</paragraph>
<other>Text</other>
</chapter>
<chapter>
<title>Text</title>
<paragraph>Text</paragraph>
<subtitle>Text</subtitle>
<paragraph>Text</paragraph>
<paragraph>Text</paragraph>
<other>Text</other>
</chapter>
ご覧のとおり、各章の字幕には永続的なパターンはありません。出力では、xml にあるのと同じ場所に字幕を設定する必要があります。段落タグには、for-each ループを使用します。このような:
<xsl:template match="chapter">
<xsl:for-each select="paragraph">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
そして今、字幕を上、段落の間、または段落の間に、xml にある順序で設定する必要があります。これどうやってするの?助けてください!