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

Re: A problem with loop and Concat....

Subject: Re: A problem with loop and Concat....
From: Mukul.Mudgal@xxxxxxxxxxx
Date: Wed, 1 May 2002 12:40:56 +0530
c concat loop
Hi Oleg Tkachenko

Thanks for your solution, here problem occur with this code
                                     <xsl:otherwise>
                                                 <xsl:value-of select
="../@Operator"/>
                                     </xsl:otherwise>
It doesn't pick otherwise @Operator value from WhereDetails.


Mukul



                                                                                                                                                
                      Oleg Tkachenko                                                                                                            
                      <olegt@xxxxxxxxxxxxx>             To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                               
                      Sent by:                          cc:                                                                                     
                      owner-xsl-list@xxxxxxxxxxx        Subject:  Re:  A problem with loop and Concat....                                  
                      rrytech.com                                                                                                               
                                                                                                                                                
                                                                                                                                                
                      04/29/2002 06:59 PM                                                                                                       
                      Please respond to xsl-list                                                                                                
                                                                                                                                                
                                                                                                                                                




Mukul.Mudgal@xxxxxxxxxxx wrote:

> I'm trying to write a xsl file to transform this
>
>                                    - <WhereDetails Operator="OR">
>                         <Description Name="accountid" Condition="=" Value
="
>                       1000" Operator="And" />
>                         <Description Name="SortCode" Condition="=" Value
="
>                       1001" Operator="Or" />
>                         <Description Name="accountType" Condition="="
Value
>                       ="Saving" Operator="" />
>
>                     </WhereDetails>
>
>                   in to this
>                   - <WHERE>
>               <Clause Value="accountid = 1000 And sortCode = 1001 Or
>             accountType = Saving  " />
>             </WHERE>
>
>
> Here , we need to take care of one point......
> 1. If there is no operator is defined in <Description> node then we need
to
> take the Operator which defined in <WhereDetails> node.


That's very simple one, where was your trouble?

<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
             <xsl:template match="WhereDetails">
                         <WHERE>
                                     <xsl:attribute name="Value">
                                                 <xsl:apply-templates/>

                                     </xsl:attribute>
                         </WHERE>
             </xsl:template>
             <xsl:template match="Description">
                         <xsl:value-of select="@Name"/>
                         <xsl:text> </xsl:text>
                         <xsl:value-of select="@Condition"/>
                         <xsl:text> </xsl:text>
                         <xsl:value-of select="@Value"/>
                         <xsl:text> </xsl:text>
                         <xsl:choose>
                                     <xsl:when test="@Operator">
                                                 <xsl:value-of select="
@Operator"/>
                                     </xsl:when>
                                     <xsl:otherwise>
                                                 <xsl:value-of select
="../@Operator"/>
                                     </xsl:otherwise>
                         </xsl:choose>
                         <xsl:text> </xsl:text>
             </xsl:template>
</xsl:stylesheet>

--
Oleg Tkachenko
Multiconn International, Israel


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list









 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.