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

Getting the value of previous Sibling

Subject: Getting the value of previous Sibling
From: "Animesh Sharma" <asharma@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Jul 2004 16:19:12 +0530
xsl previous sibling
Hi, 

I want to insert a value of previous sibling in the next. 
Basically there are two consecutive <input> tag. I want to insert the
"name", "value" attribute of first input tag in second one.

I tried with following template:

<xsl:template match="//input">
<xsl:if test="@type='radio'">
<xsl:copy>
     <xsl:variable name="name"><xsl:value-of
select="preceding-sibling::element[position()=1]/@name"
/></xsl:variable>
     <xsl:variable name="value"><xsl:value-of
select="preceding-sibling::element[position()=1]/@value"
/></xsl:variable>    	
	<xsl:apply-templates select="@*"/>
    <xsl:attribute name="onclick">$name,$value</xsl:attribute>
   <xsl:apply-templates select="*|text()"/>

</xsl:copy>
</xsl:template>

Can somebody help.

Thanks,
Animesh

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.