を使用して別のタグに残っている:私の入力XMLファイル<p> </p>別の要素に、私は一つの要素で段落の最初のセットと段落の第2のセットを取りたいつのタグに特定の段落をタグ付けする必要があり、XSLT
私はとして使用<topic class="- topic/topic " outputclass="TOPIC-MLU-Body">
<title outputclass="MLU-Body">Body</title>
<body class="- topic/body ">
<p class="- topic/p ">Insulin is a medicine</p>
<fig class="- topic/fig ">
<image class="- topic/image "
href="SBX0139003.jpg"
outputclass="Fig-Image_Ref" placement="break"/>
<p class="- topic/p " outputclass="Fig-Text">Caption</p>
</fig>
<p class="- topic/p ">So, to try and lower your blood glucose levels</p>
</body>
</topic>
XSL:私は段落は、「テキスト・トップ」などの図形要素の前に来て、「text_bottom」などの図形要素の後に必要
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="topic[@outputclass='TOPIC-MLU-Body']">
<body>
<text>
<text_top><xsl:value-of select="title|body/p"/></text_top>
<text_bottom><xsl:value-of select="body/fig|p"/></text_bottom>
</text>
<xsl:apply-templates/>
</body>
</xsl:template>
</xsl:stylesheet>
私はのような出力を取得しています:
<mlu9_body>
<mlu9_text>
<text_top>Insulin is a medicine So, to try and lower your blood glucose levels</text_top>
<text_bottom>Caption</text_bottom>
</mlu9_text>
</mlu9_body>
しかし、私の予想される出力は次のとおりです。サクソンPEとバージョン= 2.0スタイルシートを使用して
<mlu9_body>
<mlu9_text>
<text_top>Insulin is a medicine</text_top>
<text_bottom>So, to try and lower your blood glucose levels</text_bottom>
</mlu9_text>
</mlu9_body>
イム。私にこの提案をお願いします。前もって感謝します。
ありがとう@Tim、その働き – User501