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

Re: Save value in variable or param?

Subject: Re: Save value in variable or param?
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Thu, 08 Jun 2006 09:56:37 +0300
xsl save variable
Hi,

Place the logic inside the variable or parameter. Inside a variable or parameter the stylesheet output is directed to that variable or parameter content.

Here it is a simple example:

<xsl:variable name="test">
  <xsl:choose>
    <xsl:when test="x=1">x is one</xsl:when>
    <xsl:otherwise>x is not one</xsl:otherwise>
  </xsl:choose>
</xsl:variable>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Niklas Holmberg wrote:

Hi!


I have a number of if-cases to but different values to a variable that i
want to use later but i can't get i to work. Is it even possible to do
with variable or param? Or maybe some other way?

<xsl:for-each select="root/row">
	<xsl:if test="number &gt;= 200">
		<xsl:if test="number &lt;= 299">
			<xsl:param name="weight" select='"weight2"'/>
		</xsl:if>
	</xsl:if>
	<xsl:if test="number &gt;= 300">
		<xsl:if test="number &lt;= 399">
			<xsl:param name="weight" select='"weight3"'/>
		</xsl:if>
	</xsl:if>
	<xsl:if test="number &gt;= 400">
		<xsl:if test="number &lt;= 499">
			<xsl:param name="weight" select='"weight4"'/>
		</xsl:if>
	</xsl:if>

<li><xsl:attribute name="class"><xsl:value-of
select="$weight"/></xsl:attribute>hej</li>
</xsl:for-each>

Thanks!
/Niklas




Confidentiality Notice: This e-mail transmission may contain confidential or legally privileged information that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited and may be unlawful. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete all copies of this message.

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.