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


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


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