[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Ignoring a duplicate


Subject: [xsl] Ignoring a duplicate
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Sat, 8 Sep 2012 04:11:47 -0700

I cannot get the choice to work: it does not copy either <Item> and if I negate the test
<xsl:when test=" not(preceding-sibling::Item[1] eq .)"/>
it copies both. What am I doing wrong in the test?
Thanks,
Mark


<List>
<Item>
<Heading entry="subject" data="AleE!, MikolC!E!. 1852-1913">
<ToRef xref="see" data="Artists - AleE!, MikolC!E!. 1852-1913" file="a" block="A55-2"/>
</Heading>
</Item>
<Item>
<Heading entry="subject" data="AleE!, MikolC!E!. 1852-1913">
<ToRef xref="see" data="Artists - AleE!, MikolC!E!. 1852-1913" file="a" block="A55-2"/>
</Heading>
</Item>
<List>


<xsl:template match="Item">
<xsl:if test="descendant::ToRef">
<xsl:choose>
<xsl:when test=" preceding-sibling::Item[1] eq ."/> <!-- Ignore the second (and further) identical sequential Items -->
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
..... <!-- lots of other transformations going on -->
</xsl:template>



Current Thread