| | |
XSL related question
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
•
•
Join Date: Oct 2008
Posts: 9
Reputation:
Solved Threads: 0
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
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
•
•
•
•
Take a look at this for dynamic variable names with xsl.
http://bytes.com/forum/thread758105.html
![]() |
Similar Threads
- SSI and CGI : Capture a value? (ColdFusion)
- HTML and ASP question on books? (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: How to have only administrator for the website
- Next Thread: JS don't include window.open popup in browser history
Views: 616 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax anathor application asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration content contenttype courier css database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownmenu edit expose feedback flash flv form formatdecimal forms formview google grid gridview homeedition hosting identity iframe iis index javascript jquery list menu migration mono mssql multistepregistration nameisnotdeclared object objects order problem ratings refer rotatepage save search security serializesmo.table session silverlight smartcard software sql sqlserver2005 suse textbox tracking typeof unauthorized update validation vb vb.net video view virtualdirectory vista visual-studio visualstudio web webarchitecture webdevelopemnt xml youareanotmemberofthedebuggerusers






