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

RE: using HTML editors with XSL

Subject: RE: using HTML editors with XSL
From: Charlie Cox <xmldev@xxxxxxxxx>
Date: Fri, 17 Mar 2000 07:36:20 -0800 (PST)
RE: using HTML editors with XSL
move your variable assignment outside your template to
make it a global definition visible to all templates.

variables defined in a template are only visible
within that template.

Charlie

--- prasadm@xxxxxxx wrote:
> Hi guys,
> 
> I am writing a stylesheet to generate an HTML
> output. A variable value is
> set
> in the parent template and I am trying to access the
> same in the child
> templates as shown below.
> 
> <MAINTAG num="2">
> <FIRST>
> 	<COL1> abc </COL1>
> 	<COL2> 123 </COL2>
> <FIRST>
> <SECOND>
> ...
> </SECOND>
> </MAINTAG>
> 
> In the style sheet I put the attribute "num" value
> into a variable in
> MAINTAG template 
> and want to access the same in the template for
> FIRST.
> written for "FIRST" or "SECOND", etc.
> 
> <xsl:template match="MAINTAG">
> <xsl:variable name="num">
> <xsl:value-of select="@num"/>
> </xsl:variable>
> 	<xsl:apply-template select="FIRST">
> 	<xsl:apply-template select="SECOND">
> </xsl:template>
> 
> <xsl:template match="FIRST">
> 	<INPUT TYPE="HIDDEN" NAME="hidNum">
> 	<xsl:attribute name="VALUE">
> 	<xsl:value-of select="$num"/>
> 	</xsl:attribute>
> 	<xsl:apply-templates/>
> <xsl:template>
> 
> 
> When I use the parser to parse this, it gives an
> error saying unknown
> variable.
> How is the scope of a variable defined.
> Is this possible to do or not? If not, is there any
> work around.
> 
> Thanks,
> Prasad
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


 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.