473,793 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Continuing Heartache - Newbie

7 New Member
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 1109
jkmyoung
2,057 Recognized Expert Top Contributor
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
1569
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 during my testing they have...and that causes problems when the app reloads the table w/current data and encounters already existing keys...
4
11105
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. However, when I open the window, JavaScript immediately issues the next command statement. How can I get JavaScript to wait until the window is closed before continuing? Here's visually what I'm trying to do: statement1; GB_show('mycaption,...
1
2606
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 in J) if (j == 3) break.continue;
1
972
by: madankarmukta | last post by:
Hi, What should I do for continuing my task even if the user gets logged off? Thanks!
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.