|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Getting the value of 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








