XSL related question

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 9
Reputation: anithajoe is an unknown quantity at this point 
Solved Threads: 0
anithajoe anithajoe is offline Offline
Newbie Poster

XSL related question

 
0
  #1
Oct 7th, 2008
Hi I wasn't sure as to where I need to post XSL related questions..Is there anyone in this group who has expertise with XSL? If anyone can help me out with an XSL related question, that would be great.

Ani
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: XSL related question

 
0
  #2
Oct 7th, 2008
Take a look at this for dynamic variable names with xsl.

http://bytes.com/forum/thread758105.html
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 9
Reputation: anithajoe is an unknown quantity at this point 
Solved Threads: 0
anithajoe anithajoe is offline Offline
Newbie Poster

Re: XSL related question

 
0
  #3
Oct 7th, 2008
In the code below I am just writing a simple for loop in XSL...Instead of creating a dynamic variable name, I have created a variable called sublink1 and later give a dynamic value to it based on loop variable's current value...Later construct a link with "sublink1"..Concept works fine without the for-each..I mean it generated only one link rather than 2 links...But when i give for-each, it doesn't display either of the links...

XML file:
<item>
<count>one</count>
<sub>2</sub> /*this tells the XSL file as to how many sublinks are listed..I
have used that for running the for loop*/
<sublink1>http://www.yahoo.com</sublink1>
<subtitle1>Yahoo</subtitle1>
<sublink2>http:www.google.com</sublink2>
<subtitle2>Google</subtitile2>

</item>

XSL file:

<div id="sublinklist" align="left" class="anylinkcss" style="width: 70.5px; background-color: black">
<xsl:for-each select="$sub">
<xsl:variable name="sublink1">
<xsl:value-of select="concat('sublink',$sub)"/>
</xsl:variable>
<xsl:variable name="subtitle1" select="subtitle1"/>
<a href="{sublink1}">
<xsl:value-of select="subtitle1"/>
</a>
</xsl:for-each>
</div>

Any suggestions?

Ani
Originally Posted by dickersonka View Post
Take a look at this for dynamic variable names with xsl.

http://bytes.com/forum/thread758105.html
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC