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

Can i assign value to a variable and used it in differ

Subject: Can i assign value to a variable and used it in different templat e
From: Eldho George <georgee@xxxxxxxxxxx>
Date: Tue, 21 Sep 2004 11:11:15 +0530
xsl variable assign value
Hi all
Thanks to all of your immediate response

I have the following template 

<xsl:template name="process-style">	
	<xsl:if test="normalize-space($name)='border' and self::table">
		<xsl:variable name="bordervalue" select='"$value"'/>
	</xsl:if>		
</xsl:template>

Actually i am used this template for processing inline style.(above is a
part of that).
name variable contains the attribute name present in style attribute.My aim
is to
check whether the name is border,then i store it value to some variable.I
want to use 
this variable in  some other templates.

<xsl:template name="tablechildborder">
	<xsl:if test="number($bordervalue) &gt; 0 ">			
		<xsl:attribute name="border-style">solid</xsl:attribute>
		<xsl:attribute name="border-separation">1pt</xsl:attribute>

		<xsl:attribute name="border-left-width">thin</xsl:attribute>
		<xsl:attribute
name="border-right-width">thin</xsl:attribute>
		<xsl:attribute name="border-width">thin</xsl:attribute>
	</xsl:if>
</xsl:template>

<xsl:template name="tableborder">
	<xsl:when test="number($bordervalue) &gt; 0 ">
		<xsl:attribute name="border">
			<xsl:call-template name="createborder">
				<xsl:with-param name="tborder"
select="$bordervalue"/>
			</xsl:call-template>
		</xsl:attribute>
	</xsl:when>
</xsl:template>

I tried this one.But i could not get the $bordervalue inside tableborder and
tablechildborder template.First time it shown some error.Then i make the
variable bordervalue
as global.

<xsl:stylesheet 
  version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"
  xmlns:fox="http://xml.apache.org/fop/extensions">

<!-- ==============================================
	Global variable declaration
==================================================-->
<xsl:variable name="bordervalue"/>

// All my template present here

</xsl:stylesheet>


How can i solve this problem?Can i assign a value to variable and use it in
other template.
Please help me.


Thanks in advance

George



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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.