473,385 Members | 1,766 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,385 software developers and data experts.

Need to check for additional text in an element

What I'd like to do is to check the values in an element if they're
greater than a certain time and if they are, then change the font color
of the time. I have about 10 elements that I will check against a
different time for each element, I'm just showing one element below in
my XML file. The time checking I have in the XSL file below works fine.
As you can see by my XSL file below I'm checking if this element
'LASTISA' if it's time is greater than 11:00 PM. And if it's before
11:00 PM the color will be green after 11:00 PM it would be orange.

Now, what I'd like to do is to check if the element has the text
'running' in it, if it does then I would like the 'running' text to be
in red. Example: <LASTISA>running</LASTISA>

I tried using another <xsl:when> and a <xsl:if> statement, but it
always defaults to the color green.

Any ideas???
Thanks
Rich

Part of my XML file:
<?xml version="1.0" standalone="yes"?>
<MSR>
<Info>
<LASTISA>11:01 PM Wednesday</LASTISA>
</Info>
</MSR>

Part of my XSL file:
<xsl:template match="LASTISA[. != '']">
<xsl:variable name="hours" select="number(substring-before(.,':'))"/>
<xsl:variable name="minutes"
select="number(substring(substring-after(.,':'),1,2))"/>
<xsl:variable name="PM" select="contains(.,'PM')"/>
<li>ISA DataBase ended at: <font><xsl:attribute name="color">
<xsl:choose>
<xsl:when test="$PM and ($hours &gt;= 11) and ($minutes &gt;
0)">#FF6600
</xsl:when>
<xsl:otherwise>#00008B
</xsl:otherwise>
</xsl:choose>
</xsl:attribute><xsl:value-of select="." /></font></li>
</xsl:template>

Jul 20 '05 #1
0 1374

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
I want to know if we need id attribute? Or just name attribute is fine? For example: Name: <input type="text" id="text" name="fname">
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
3
by: ash | last post by:
Hey I am new, but I don't have time to intruduce myself yet. I am intro to C++ and this is a programme I have to write. all the direction are here, It will be very nice of someone to figure this...
8
by: Sandy | last post by:
Hello - This code was snagged by me from the Internet and altered. Its purpose is to check for swear words. It works the way it currently is, but I need it to be more generic -- i.e., I don't...
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
3
by: sunbeam | last post by:
Short Description of the Project: we developed a e-learning system for our students. each student has a unique username/password to view the modules he/she should view and nothing more. since we...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
3
by: Water Cooler v2 | last post by:
Sorry for asking this beginner question. I've written DTDs so far and read about XML Schemas. I understand that they are a replacement of the DTD fundamentally, and therefore allow for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.