Uzytkownik "Mystagogue" <ba****@axiscode.comnapisal w wiadomosci
news:72**********************************@18g2000h sf.googlegroups.com...
Given XML like this...
<stuff>
<thing id="1" result="true"/>
<thing id="2" result="true"/>
<thing id="3" result="false"/>
<thing id="4" result="false"/>
<thing id="5" result="error"/>
</stuff>
Is there an XPath statement that will select only *unique* "@result"
samples? For example, given the above, I'd like to have "thing"
results that consist only of id 1, 3 and 5, because id 2 and 4 are
duplicate result types. Anybody?
In my opinion quite good way is using "attributes features". It does mean in
one element you may have attributes only with unique names. For example:
<xsl:apply-templates select=//@*/>
....
<xsl:template match="@*">
<xsl:attribute name="{.}">whatever</xsl:attribute>
</xsl:template>
Result: element with attributes done from unigue (distinct) values
--
td
xmlguru.net