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

How to avoid the duplicate being printed [ URGENT !!!

Subject: How to avoid the duplicate being printed [ URGENT !!! ]
From: "Sri ni" <srini75@xxxxxxxxxxx>
Date: Mon, 04 Jun 2001 09:36:42 -0000
xsl avoid duplicate
All,

My XML reads as follows:
--------------------------
<Messages>
<Message date="2001-06-01 14:24:02.0" id="10" parentId="0" sectionId="10">
<Title>first title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 14:24:51.0" id="11" parentId="0" sectionId="10">
<Title>second title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 14:25:16.0" id="12" parentId="0" sectionId="10">
<Title>third title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:12:22.0" id="13" parentId="0" sectionId="10">
<Title>fourth title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:31:51.0" id="15" parentId="10" sectionId="10">
<Title>reply to first titel</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:34:04.0" id="16" parentId="11" sectionId="10">
<Title>rely to second title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:34:50.0" id="17" parentId="15" sectionId="10">
<Title>re re first title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:36:22.0" id="18" parentId="12" sectionId="10">
<Title>reply to third title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:36:52.0" id="19" parentId="13" sectionId="10">
<Title>reply to fourth title</Title>
<Author>vasan</Author>
</Message>

<Message date="2001-06-01 16:37:18.0" id="20" parentId="0" sectionId="10">
<Title>fifth title</Title>
<Author>vasan</Author>
</Message>

</Messages>

My xsl reads as follows:
-------------------------
<xsl:template match="Messages">
		<xsl:apply-templates select="Message[@parentId=0]"/>
</xsl:template>

<xsl:template match="Message">
<DIV onclick="getMessage(this);" style="margin-left:36px;cursor:default;" >
<xsl:attribute name="messageID"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:attribute name="sectionID"><xsl:value-of select="@sectionId"/></xsl:attribute>
<xsl:attribute name="parentID"><xsl:value-of select="@parentId"/></xsl:attribute>
<xsl:value-of select="Title"/>
<xsl:text>
</xsl:text>
<xsl:text>by
</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>
</xsl:text>
<xsl:value-of select="Author"/>
<xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
<xsl:apply-templates select="../Message[@parentId=$id]"/>
</DIV>
</xsl:template>



Current Output: ================ first title by vasan

reply to first titel by vasan

re re first title by vasan

second title by vasan

rely to second title by vasan

third title by vasan

reply to third title by vasan

fourth title by vasan

reply to fourth title by vasan

***************DUPLICATED AGAIN**************
reply to first titel by vasan

re re first title by vasan

rely to second title by vasan

re re first title by vasan

reply to third title by vasan

reply to fourth title by vasan
*******************END DUPLICATE************

fifth title by vasan

I want to get rid of this duplicate entires, as it has been printed already, how shall i do it??.

Can anyone help me out please please...

Thanks
Srini

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.