473,395 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Continuing Heartache - Newbie

Continuing on from my heartache post earlier, can I nest a <choose> element inside of:

Expand|Select|Wrap|Line Numbers
  1. <td align="center" style="border: 3px solid #CC0033" bgcolor="#FFAABF" class="v10">

Ie: is the following statement correct?

Expand|Select|Wrap|Line Numbers
  1. <td align="center" style="border: 3px solid #CC0033" bgcolor="#FFAABF" 
  2.  
  3. <xsl:choose>
  4.   <xsl:when test="base &gt 11">
  5.     class="v10green"
  6.   </xsl:when>
  7.   <xsl:when test="base &lt 0">
  8.     class="v10red"
  9.   </xsl:when>
  10.   <xsl:otherwise>
  11.     class-"v10black"
  12.   </xsl:otherwise>
  13. </xsl:choose>
  14.  
  15. >
I tried this but it wouldn't work. Can <choose> be nested inside of <tb>? Can a <choose> be nested inside another <choose>?


See the data below:
Expand|Select|Wrap|Line Numbers
  1.     <abilities>
  2.         <ability>
  3.             <name>Strength</name>
  4.             <abbr>STR</abbr>
  5.             <base>15</base>
  6.             <modifier>+2</modifier>
  7.         </ability>
  8.         <ability>
  9.             <name>Dexterity</name>
  10.             <abbr>DEX</abbr>
  11.             <base>14</base>
  12.             <modifier>+2</modifier>
  13.         </ability>
  14.         <ability>
  15.             <name>Constitution</name>
  16.             <abbr>CON</abbr>
  17.             <base>13</base>
  18.             <modifier>+1</modifier>
  19.         </ability>
  20.         <ability>
  21.             <name>Intelligence</name>
  22.             <abbr>INT</abbr>
  23.             <base>10</base>
  24.             <modifier>+0</modifier>
  25.         </ability>
  26.         <ability>
  27.             <name>Wisdom</name>
  28.             <abbr>WIS</abbr>
  29.             <base>12</base>
  30.             <modifier>+1</modifier>
  31.         </ability>
  32.         <ability>
  33.             <name>Charisma</name>
  34.             <abbr>CHA</abbr>
  35.             <base>8</base>
  36.             <modifier>-1</modifier>
  37.         </ability>
  38.     </abilities>
Thanks for any help.

virgil, out!
Jan 4 '08 #1
1 1094
jkmyoung
2,057 Expert 2GB
In order to do this you'd have to declare the attribute seperately.
Put the > on the end of the initial tag. You can still declare attributes after:
Expand|Select|Wrap|Line Numbers
  1. <td align="center" style="border: 3px solid #CC0033" bgcolor="#FFAABF">
  2. <xsl:attribute name="class">
  3.    <xsl:choose>
  4.    <xsl:when test="base &gt 11">v10green</xsl:when>
  5.    <xsl:when test="base &lt 0">v10red</xsl:when>
  6.    <xsl:otherwise>v10black</xsl:otherwise>
  7. </xsl:choose>
  8. </xsl:attribute>
  9.  
Or you could declare the variable earlier and use the programming style as in http://www.thescripts.com/forum/thread755274.html
Jan 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Rey | last post by:
Howdy all. Am attempting to delete a large number of records (123K) from a table using: db.execute "delete from tblname" Then I double check (code below) to see if records still remain as...
4
by: Eddie | last post by:
I am opening a windows (well, technically a greybox() call GB_show() which shows a nicer window than normal), and want to wait until that window is closed before moving to the next command. ...
1
by: Jon Slaughter | last post by:
Say I have two nested foreach loops, is there any simple way of continuing out of the outter most loop depending on what happens in the inner most? e.g., foreach(int i in I) { foreach(int j...
1
by: madankarmukta | last post by:
Hi, What should I do for continuing my task even if the user gets logged off? Thanks!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.