homepage Welcome to WebmasterWorld Guest from 23.22.194.120
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
XSL Variable Instances
ebbo




msg:3969893
 4:12 pm on Aug 11, 2009 (gmt 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

 

ebbo




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

anyone able to assist?

john_k




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved