This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
How to avoid the duplicate being printed [ URGENT !!! ]
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] How to avoid the duplicate being printed [ URGENT !!! ]
- From: "Sri ni" <srini75 at hotmail dot com>
- Date: Mon, 04 Jun 2001 09:36:42 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
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