This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: To display the output depending upon condition
- To: srini vasan <srinivi27 at yahoo dot com>
- Subject: Re: [xsl] To display the output depending upon condition
- From: Jeni Tennison <jeni at jenitennison dot com>
- Date: Sat, 20 Oct 2001 15:14:37 +0100
- CC: XSL-List at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <20011018154532.62035.qmail@web11006.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Srini,
> 2. At this point I need to check whether that
> particular parentId !=0 and if yes I need to
> display that message as a particular left not a
> part of tree.
You can tell which messages are being left out by finding those
messages where the parentId is (a) not equal to 0 and (b) not the
value of the dbMessageId of any of the other Message elements.
Presumably you want these messages to be treated like top-level
messages that have a parentId of 0. Since there's no Message with an
Id of 0 anyway, you can do this in one test - find all Message
elements for which there are no Messages with an Id equal to its
parentId:
Message[not(@parentId = ../Message/@dbMessageId)]
I'd change the template for Messages to select these instead of just
those with a parentId of 0:
<xsl:template match="Messages">
<xsl:apply-templates
select="Message[not(@parentId = ../Message/@dbMessageId)]" />
</xsl:template>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list