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

M

mark4asp

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.mydomain.com</Domain>
<Destination>
<Folder>Search</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="BatchEmail/Domain" />
<xsl:variable name="folder" select="BatchEmail/Destination/Folder" />

blah blah blah...

<xsl:if test="$folder = 'Search'">
<table cellspacing="0">
<tr>
<th class="link"><a href="http://{$domain}/Search/Search.aspx"><span
class="full">Search 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">click
here.</a><br/><br/></td>
</tr>

<tr>
<th class="link"><a
href="http://{$domain}/Analysis/Analysis.aspx"><span
class="full">Analysis</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"><span
class="full">Marketplace 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">click here.</a></td>
</tr>
</table>
</xsl:if>

blah blah blah blah...
 
M

Martin Honnen

mark4asp said:
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?
 
P

P. Lepin

Martin said:
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.
 
M

mark4asp

Richard said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top