473,569 Members | 3,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I test the value of a variable in a <xsl:if ...> statement?


I'm getting a problem with this code and I think the offending linke is
:

<xsl:if test="$folder = 'Search'">

I want to test the value of the Folder element for a value of precisely
"Search" and include the extra html as shown below if the test passes.
The rest of the code validates and so, I hope, works.

What am I doing so very wrong here?
This is a relevant fragment of the xml:

<BatchEmail>
<Domain>www.myd omain.com</Domain>
<Destination>
<Folder>Searc h</Folder>
</Destination>
...
...
<BatchEmail>

Here is my problem code snippet. When I cut this snippet (below) out
the rest of the code parses with no problems:
blah blah...

<xsl:variable name="domain" select="BatchEm ail/Domain" />
<xsl:variable name="folder" select="BatchEm ail/Destination/Folder" />

blah blah blah...

<xsl:if test="$folder = 'Search'">
<table cellspacing="0" >
<tr>
<th class="link"><a href="http://{$domain}/Search/Search.aspx"><s pan
class="full">Se arch Database</span></a></th>
</tr>
<tr>
<td>Search over 5000 reports on over 1600 investors.<br /><a
class="blue" href="http://{$domain}/Search/Search.aspx">cl ick
here.</a><br/><br/></td>
</tr>

<tr>
<th class="link"><a
href="http://{$domain}/Analysis/Analysis.aspx"> <span
class="full">An alysis</span></a></th>
</tr>
<tr>
<td>Monitor contract wins, cross reference based on consultant,
mandate size, asset class, investment style and manager. Generate your
own league tables of manager inflows and mandate wins. Analyse capital
flows broken down by asset class and identify trends in consultant
manager selections.<br /><a class="blue"
href="http://{$domain}/Analysis/Analysis.aspx"> click
here.</a><br/><br/></td>
</tr>

<tr>
<th class="link"><a href="http://{$domain}/Survey/Survey.aspx"><s pan
class="full">Ma rketplace Survey</span></a></th>
</tr>
<tr>
<td>Quarterly Report. Coverage on the major deals, quantifiable net
inflows and out flow charts, net capital flows by asset class and style
and number of investors expressing an interest in a particular asset
class.<br /><a class="blue"
href="http://{$domain}/Survey/Survey.aspx">cl ick here.</a></td>
</tr>
</table>
</xsl:if>

blah blah blah blah...
Dec 20 '07 #1
4 2429
mark4asp wrote:
I'm getting a problem with this code and I think the offending linke is
:

<xsl:if test="$folder = 'Search'">

I want to test the value of the Folder element for a value of precisely
"Search" and include the extra html as shown below if the test passes.
The rest of the code validates and so, I hope, works.

What am I doing so very wrong here?
What problem exactly do you get?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 20 '07 #2
In article <47************ **********@news .astraweb.com>,
mark4asp <ma******@gmail .comwrote:
>I'm getting a problem with this code
What is the problem you are having with it?

-- Richard
--
:wq
Dec 20 '07 #3

Martin Honnen wrote:
mark4asp wrote:
><xsl:if test="$folder = 'Search'">

I want to test the value of the Folder element for a value of precisely
"Search" and include the extra html as shown below if the test passes.
The rest of the code validates and so, I hope, works.

What am I doing so very wrong here?

What problem exactly do you get?
You guys are entirely too nice and warmhearted fellas. I think such
unnatural kindness to strangers should be legally prohibited so as not to
make vindictive morons like me feel bad whenever you politely and patiently
ask neophytes for essential clarifications as observed on this thread.

--
Presented in Brain Control where available.
Dec 20 '07 #4
Richard Tobin wrote:
In article <47************ **********@news .astraweb.com>,
mark4asp <ma******@gmail .comwrote:
I'm getting a problem with this code

What is the problem you are having with it?

-- Richard
I've decided to abandon this thread. It's hard to say what difficulty
I'm having as the only error message I get from the editor when I try
to save is "Invalid file".

I've written another post below which is far more specific and gets
right down to the meat of the problem I'm trying to solve.
Dec 21 '07 #5

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

Similar topics

3
3889
by: Lizard | last post by:
OK, total newbie here, so this may be a mind-numbingly dumb question AND I may be phrasing it badly. I have an xsl:template which looks like this: <xsl:template match="LoanRecord"> <hr> <xsl:number count="LoanRecord" format="1"/><br/> Loan ID:<xsl:value-of select="loan_no"> </xsl:value-of><br/> Calculated CLTV:<xsl:value-of...
9
8313
by: Andrea Maschio | last post by:
Hi, i have a terrible noobie frustration formatting an XML file like this: <Dipendente Id="1" Anno="2003" Nome="pippo" Cognome="pippi" Nato_il="10/03" Email="pippo@emailprovider.it" Esito="ok"/> On the XSLt file relayed to this XML, i wrote in green the attribute value if Attribute "Esito" is "Ok". I mean, something, like this:
3
3591
by: Eric Theil | last post by:
I'm at my wit's end with this one. Within an xsl:if test, I'm not able to get 2 variables to properly evaluate if one of them is wrapped within a string function. <!-- This works --> <xsl:if test="$var:v141=&quot;true&quot;"> <!-- This doesn't work --> <xsl:if test="string($var:v141)=&quot;true&quot;">
5
2325
by: Luke Vogel | last post by:
Hi all, Probably a really basic question, but I cant find an answer ... I have an xml file of books something like: <product> <isbn>0-735-61374-5</isbn> <title>Microsoft Visual Basic Step By Step</title> <author>Michael Halvorsen</author> <subject>Programming</subject>
3
14271
by: tldisbro | last post by:
Hello All, I am trying to use the returned value of the <fo:page-number> element/function in my <xsl:if> test condition. But am unsuccessful in doing so. Is it possible to use it in this fashion with a conversion or correct syntax? I would like to test the current page number and see if it is even or odd - and if it is odd I would like to...
2
13682
by: riceyeh | last post by:
Hi, What does <xsl:if test="not($values)"mean? What I do not understand is $values? Here, means array? And . = $value means current node is equal to the variable value? So the total meaning is "if not exists of value in array of values" ? But the result of '. = $value' is a boolean value, so '$values' should not mean "the value in values"....
1
1811
by: Fred | last post by:
Hi, I am using XSL if to look and see if a node exists and if so display it with a header (see below). Some of the xml I transforming has nodes like this <Test /and it shows up in my html report (header no value). How do I test for this? <xsl:if test="Test"> <xsl:if test="Test"> <b><xsl:text>Header: </xsl:text></b>
1
5056
by: cfli1688 | last post by:
I saw example of xsl:if and I want to use it. I know that &gt; is greater than. Is there one for equals to, I try &eq; and it does not recognize it. Where can I get a list for this? Also, I have the following: <xsl:variable name="oldID" select="oldid"/> <xsl:variable name="currID" select="id"/> <xsl:choose> <xsl:when...
8
5644
by: Hoi Wong | last post by:
With the XSLT 1.0 engine that I was forced to use, I have to parse old XML scripts where the number (to be parsed and saved into $EPISODE_NUMBER_RAW) that I want to parse is written with a comma seperator if it goes beyond 3 digits. i.e. the variable might be parsed as a string '1,324' or a number 56, depending on which XML file I have. I...
0
7930
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. ...
1
7681
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...
0
7983
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...
0
6290
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...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
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...
0
3662
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...
1
2118
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
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.