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

how to store attribute value?

Subject: how to store attribute value?
From: Vinoth Palaniappan <vinoth@xxxxxxxxxxxx>
Date: Tue, 6 Aug 2002 16:17:29 +0530
xsl store values
Hi all,
I have a xml document as:
	<myroot  root_attribute="test_val">
		<a1/>
		<a1/>
	</myroot>
While processing the node "a1" using XSL, i need to access the value of
attribute "root_attribute" of it's parent. I tried to do in the following
way, but could not have a value-of construct within variable construct.
	<xsl:template match="myroot">
	<xsl:variable name="test_var" select="<xsl:value-of
select="@root_attribute"/>"></xsl:variable>
	<xsl:for-each select="child::*">
		<xsl:apply-templates select="*"></xsl:apply-templates>
	</xsl:for-each>
	</xsl:template>

	<xsl:template match="a1">
	<xsl:copy-of select="$test_var"/>
	</xsl:template>

How can i access the attribute of some node in the template match of another
node? Any help is appreciated. 
____________________________________________________________________________
___________
Vinoth
iDEN OMC Software, GSG
Motorola, India
voice: 91-040-3308090 extn:3208
____________________________________________________________________________
___________

 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.