Welcome to WebmasterWorld Guest from 54.144.107.83

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XSL Variable Instances

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

New User

5+ Year Member

joined:June 26, 2009
posts:3
votes: 0


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

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

New User

5+ Year Member

joined:June 26, 2009
posts:3
votes: 0


anyone able to assist?
3:54 pm on Aug 21, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 3, 2003
posts:792
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members