[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] filtering out one element
In listing 1, I have code that rejects duplicate <Article> elements in a
sorted list made up of items similar to those in Listing 2. Right now, the
filter considers the entirety of the immediately preceding sibling
<Article>. I think this code seems to work as advertised.
However, I now want it to disregard the <Page> element during the comparison so that the two articles in Listing 2 would be considered identical and the "citation" template in Listing 1 would not be called. I tried : <xsl:if test="not(Title eq preceding-sibling::Article[1]/Title) and not(Year eq preceding-sibling::Article[1]/Year) and not(IssueNumber eq preceding-sibling::Article[1]/IssueNumber)" but that code does not work at all. What is the proper way to remove duplicates by comparing the Title, Year, and IssueNumber elements while ignoring the Page element in the immediately preceding Article?? Thanks, Mark Listing 1. <!-- Each title will have one or more citations --> <xsl:template match="Article" mode="format"> <xsl:if test="not(. eq preceding-sibling::Article[1])"> <xsl:call-template name="citation"/> <xsl:apply-templates select="Comment"/> </xsl:if> </xsl:template> Listing 2. <Article> <Title>Future Issues</Title> <IssueName>Apr</IssueName> <Year>1948</Year> <Page>38</Page> <IssueNumber>4</IssueNumber> </Article> <Article> <Title>Future Issues</Title> <IssueName>Apr</IssueName> <Year>1948</Year> <Page>39</Page> <IssueNumber>4</IssueNumber> </Article>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|