아래의 그림과 같이 키인 Muenchian 그룹을 사용하여 city1 또는 city2 또는 city3에서 중복을 제거 할 수 있습니다. 하지만xslt를 사용할 때 중복을 제거하는 방법
<test>
<records>
<city1>Sweden</city1>
<country1>value1<country1>
<town1>value2<town1>
<city2>Paris</city2>
<country2>value1<country2>
<town2>value2<town2>
<city3>London</city3>
<country3>value1<country3>
<town3>value2<town3>
</records>
<records>
<city1>Sweden</city1>
<country1>value1<country1>
<town1>value2<town1>
<city2>Frankfut</city2>
<country2>value1<country2>
<town2>value2<town2>
<city3>NEwYork</city3>
<country3>value1<country3>
<town3>value2<town3>
</records>
<records>
<city1>SFO</city1>
<country1>value1<country1>
<town1>value2<town1>
<city2>London</city2>
<city2>Frankfut</city2>
<country2>value1<country2>
<city3>Frankfut</city3>
<country3>value1<country3>
<town3>value2<town3>
</records>
</test>
출력이 city1
에서 중복을 제거하기 위해 사용Row|Add|Sweden|value1|value2
Row|Add|London|value1|value2
Row|Add|NewYork|value1|value2
Row|Add|SFO|value1|value2
코드되어야 XML 모든 city1, 시티 2와 시티 3 다음
에 반복하여 중복을 제거 할 수 있습니다 아니다
<xsl:key name="Keycity" match="//test/records" use="city1" />
<xsl:for-each select="//records[generate-id(.) = generate-id(key('Keycity', city1))]">
<xsl:sort select="."/>
<xsl:variable name="city1" select="."/>
<Row Action="ADD">
<xsl:value-of select="city1" />
</Row>
</xsl:if>
</xsl:for-each>
XSLT가 예상 출력 (XML 대 텍스트)과 일치하지 않습니다. 그리고 왜 코드에 ''이 고아가 되었습니까? –