471,073 Members | 1,145 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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.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...
Dec 20 '07 #1
4 2284
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Andrea Maschio | last post: by
3 posts views Thread by Eric Theil | last post: by
5 posts views Thread by Luke Vogel | last post: by
1 post views Thread by Fred | last post: by
1 post views Thread by cfli1688 | last post: by
reply views Thread by leo001 | last post: by

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.