[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Duplicate Elimination
On 12/03/2014 23:42, Ihe Onwuka wrote:
As suspected it was possible to avoid grouping. See the predicate tacked on to B/Date. It seems unlikely that that predicate is ever going to be true (unless you have a structure like <B><Date>aaa<A><Date>aaa</Date></A></Date></B> but that would sort with the string value of the B element and nested A element, which would be odd. I suspect you intended <xsl:apply-templates select="A/Date | B/Date[not(current()/A/Date/text() = text())]> But unlike muenchian grouping or xsl-for-each (both of which actually have a simpler syntax than this) this will (unless you have a very aggressively optimising XSLT engine) be quadratic in performance as the full A list is going to be searched for every B. Also of course using text() rather than <xsl:apply-templates select="A/Date | B/Date[not(current()/A/Date = .)]> means the code is very fragile and will break if comments spit up the text nodes. David
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
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
|