Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2004, 10:41 AM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default eliminate duplicates where attribute names differ

Using 1.1 with exsl
Here's maybe a hard one for you guys:
I have this problem:
<userList>
<user name="dan"/>
<user name="john"/>
<user name="frank"/>
<user name="tim"/>
<user name="stan"/>
</userList>

<network>
<box account="dan"/>
<box account="john"/>
<box account="frank"/>
</network>

I've already eliminated duplicates in each list
I need to output:

<td>tim</td>
<td>stan</td>

 
Old August 9th, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

something like this will do it, just insert the correct path:
Code:
<xsl:template match="user">
    <xsl:if test="count(/PATH TO NETWORK/network/box[@account=current()/@name])=0">
        <td><xsl:value-of select="@name"/></td>
    </xsl:if>
</xsl:template>
 
Old August 9th, 2004, 09:29 AM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks!
that helped alot!

the more I learn about this stuff the cooler it becomes






Similar Threads
Thread Thread Starter Forum Replies Last Post
unique attribute names for form elements fishmonkey XSLT 3 March 16th, 2008 07:46 PM
Safari attribute names getting lowercased ChrisScott Ajax 0 August 1st, 2006 11:42 AM
How to eliminate all the extra zero? kuku SQL Server 2000 3 June 29th, 2005 09:47 PM
eliminate duplicates in selected columns Callie SQL Server 2000 3 April 29th, 2004 10:57 PM
Stored Procedure/Command Object results differ John K. King Access VBA 0 November 20th, 2003 11:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.