[OK]を、これは何回かカバーされていることを知っていますが、以前の答えは私が探している結果を与えるようではありません。 xsltは私が期待しているように直線的に処理していないかもしれませんが、そうでなければxsltに対処する方法はわかりません。あなたが見ることができるようにxslを使って重複を無視するにはどうすればいいですか
<?xml version="1.0" encoding="UTF-8"?>
<root>
<section>A</section>
<divider/>
<divider/>
<section>B</section>
<divider/>
<section>C</section>
<divider/>
<divider/>
<section>D</section>
<divider/>
</root>
、要素を複製たまにあります
のは、私はxmlファイルを持っているとしましょう。 XSLTを使用した:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:strip-space elements="*" />
<xsl:template match="/root">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="section">
<xsl:value-of select="text()"/>
</xsl:template>
<xsl:template match="divider">
<xsl:if test="not(preceding-sibling::divider)">
<xsl:text>--</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
私は
A
--
B
--
C
--
D
--
を見て期待していた...それは何が起こっているかではありません。私が何が欠けているか教えてもらえますか?私は今取得しています何
は次のとおりです。
A
--
B
C
D
実際に起こっていることを追加して、わかりますか? –