This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: To display the output depending upon condition


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]