그래, 몇 번이나 다뤘다는 것을 알았지 만, 이전의 대답은 내가 찾던 결과를주는 것 같지 않습니다. 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
실제로 일어나는 일을 추가하여 마음을 알 수 있습니까? –