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

RE: Use of Parameter with conditional logic - please h

Subject: RE: Use of Parameter with conditional logic - please help!
From: "Oleg Tkachenko" <olegt@xxxxxxxxxxxxx>
Date: Thu, 2 Aug 2001 23:33:13 +0200
xsl conditional logic
Hello Warren !

Try "BaseSymbol=$basesym" expression.

<xsl:param name="basesym"/> 
<xsl:template match="/">
	<HTML>
		<xsl:for-each select="News/FullStory">
		<xsl:choose>
			<xsl:when test="BaseSymbol=$basesym">
				<xsl:value-of select="Story"/>
			</xsl:when>
			<xsl:otherwise>
			...

---
Oleg Tkachenko,
Multiconn International 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Warren Keane
> Sent: Thursday, August 02, 2001 9:52 PM
> To: Xsl-List@Lists. Mulberrytech. Com (E-mail)
> Cc: Chris Sharp
> Subject:  Use of Parameter with conditional logic - please help!
> 
> 
> Hello, 
> 
> I have an XML document which contains multiple news headlines. 
> Each headline
> also as an associated story as in: 
> 
> <News>
> <FullStory>
>   <BaseSymbol>SP</BaseSymbol> 
>   <HeadLines>Equity futures end firmer but again fail to maintain intraday
> highs</HeadLines> 
>   <Story>Equity futures ended Wednesdays session higher, but in a carbon
> copy of Tuesdays trade, reversed the days major gains and closed near
> opening levels. Futures shook off mostly weak economic data this morning,
> focusing instead on a research note out of Merrill Lynch, which 
> hinted at a
> nadir for the semiconductor sector.</Story> 
> </FullStory>
> </News>
> 
> I have created an XSL doc which makes an HTML document for displaying the
> headlines as so: 
> 
>  <xsl:for-each select="News/FullStory">
>       <LI><A>
>          <xsl:attribute name="HREF">headline.asp?storyid=<xsl:value-of
> select="BaseSymbol"/>
>          </xsl:attribute>
>          <xsl:value-of select="HeadLines"/>
>       </A></LI>
>       </xsl:for-each>
> 
> This works fine. 
> 
> I have figured out MSXML2.XSLTemplate and how to pass the BaseSymbol
> parameter of the headline selected to the second XSL file for 
> displaying the
> full story associated (via BaseSymbol) with the headline. My 
> problem is that
> I don't know how to work with the parameter. I can display it in HTML so I
> know the second XSL file is receiving the parameter. So far my second XSL
> looks like this:
> 
> <xsl:param name="basesym"/> 
>   <xsl:template match="/">
>     <HTML>
>        The parameter value was: <xsl:value-of select="$basesym"/>
>     <xsl:for-each select="News/FullStory">
>        	<xsl:choose>
>           <xsl:when test="[BaseSymbol=<xsl:value-of select="$comsym"/>">
>                 <xsl:value-of select="Story"/>
>           </xsl:when>
>                  <xsl:otherwise>
>                    ......
>                  </xsl:otherwise>
>                </xsl:choose>
>    </xsl:for-each>
> 
> 
> The parameter value is displayed correctly but I can't get the conditional
> logic to work.  I have tried many things including the use of variables. I
> think I just need the syntax for the <xsl:choose> that can use the
> parameter. Any suggestions are appreciated, I have been up all night and
> leave for vacation today, I promised my boss this would be done.
> 
> Thanks in advance. `
> 
> 
>  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.