This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: To display the output depending upon condition
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] To display the output depending upon condition
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Sat, 20 Oct 2001 02:13:07 +0200
- References: <20011018154532.62035.qmail@web11006.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
I don't know really what you want, my only presumption is that the
output-tree of your transformation is missing. Your transformation is
correct I think, you only need the tree. Therefore you must copy the given
tags.
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output encoding="iso-8859-1"/>
<xsl:strip-space elements="*"/>
<xsl:template match="Sections">
<xsl:copy>
<xsl:apply-templates select="Messages" />
</xsl:copy>
</xsl:template>
<xsl:template match="Messages">
<xsl:copy>
<xsl:apply-templates select="Message[@parentId=0]"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Message">
<xsl:copy>
<xsl:apply-templates
select="../Message[@parentId=current()/@dbMessageId]"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
If this is not what you want, you must explain the problem more explicitly.
Joerg
> But What I need is:
>
> 1. Now the grouping starts with parentId=0 and then
> grouping all the child with them.
>
> 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.
>
> 3. The reason for this query was if I do a search
> via my web interface I might get some data whose
> parentId !=0, since this XSL starts with
> parentId=0, I AM NOT GETTING THAT TREE AT ALL.
>
> Please help me to solve this problem.
>
> Many Thanks
> Srini
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list