Welcome to WebmasterWorld Guest from 54.227.101.214

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XSL Variable Instances

     

ebbo

4:12 pm on Aug 11, 2009 (gmt 0)

5+ Year Member



I am a complete noob with no experience, so please little jargon and good examples appreciated!

Here is my code:


<xsl:template match="BDP">
<xsl:value-of select="../SECURITY"/>
<br/>
<!--<p class="BDP">-->
<xsl:variable name="num">
<xsl:number count="*" level="any"/>
</xsl:variable>
<xsl:variable name="myid" select="concat('bdp',$num)"/>
<span style="cursor:pointer;">
<xsl:attribute name="onmouseover">
<xsl:value-of select='concat($myid,".style.color=&apos;black&apos;")'/>
</xsl:attribute>
<xsl:attribute name="onmouseout">
<xsl:value-of select='concat($myid,".style.color=&apos;white&apos;")'/>
</xsl:attribute>
<img src="#!-- #IMAGES:mvicon.gif --#" style="margin-left:0%;margin-right:1%;position:relative;bottom:-0.6%;"/>
</span>
<span class="bdp">
<xsl:attribute name="id">
<xsl:value-of select="$myid"/>
</xsl:attribute>

<xsl:apply-templates/>
</span>
<!--</p>-->
</xsl:template>

when I use this, the value of SECURITY stays only on the first instance in my XML file,

so e.g display looks like

SECURITY 0.5
BDP 100.00

SECURITY 0.5
BDP 200.00

SECURITY 0.5
BDP 300.00

instead of

SECURITY 0.5
BDP 100.00

SECURITY 0.4
BDP 200.00

SECURITY 0.75
BDP 300.00

can someone please show me the code how to change
<xsl:value-of select="../SECURITY"/> so that it doesn't only show first instance?

If you need more info please say

thank you for your helps

ebbo

10:15 am on Aug 13, 2009 (gmt 0)

5+ Year Member



anyone able to assist?

john_k

3:54 pm on Aug 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post a sample of the XML data if you still need help on this.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month