Hello ,
um using xpath into jsp .
According to what I know that the following :

<xpath:set var="channel_name" select="channelName" />

returns a string .
Let's assume that the value of this string is "foo"
I need to compare this string with other string !!
like
if (var1=="foo") then
do smth

I have already used this :

<xpath:comapre(channel_name,"foo") />

but it doesn't work .

Please advice .

Recommended Answers

All 2 Replies

I've never seen the <xpath:set> or <xpath:compare> instructions before, so I have to assume those are custom functions you're using.

But a simple boolean xpath direct string comparison should work. If the value of your variable is 'foo' the xpath below results in true.

channel_name = 'foo'

Also in your code listed you have it spelled "comapre" instead of "compare" Could it be a typo?

Thanks iceandrews .
It seems that um going to switch to Velocity mean time .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.