[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Ignoring a duplicate

Subject: Ignoring a duplicate
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Sat, 8 Sep 2012 04:11:47 -0700
 Ignoring a duplicate
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.