[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: To display the output depending upon condition

Subject: Re: To display the output depending upon condition
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Sat, 20 Oct 2001 02:13:07 +0200
if condition depending on output
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.