Wednesday, February 24, 2010

Inline If Else Statment


This week I had come across an issue where I had a situation in the template to put 2 inline if statements one after the other.


 

Some statement if@inline:1=2 Result 1 end if if@inline:1=1 Result 1 end if


 

But in the output it printed both results of if statements. I do not know the reason for this. So as usual went for google and landed in our guru Tim Dexter's Dec 2007 post.


 

He had explained this xdoxslt:ifelse(boolean expression ,true result, false result)


 

Example,

xdoxslt:ifelse(.//WM_FLAG='C','Canceled','Approved')


 

This xdoxslt command is looking exactly like a SQL Decode statement with only one level ;) and it's a inline statement, that the sexy thing about this statement. Thanks Tim.



1 comment:

Anonymous said...

Simply wish to say your article is as amazing. The clarity for
your submit is simply great and i could think you are an expert on this subject.
Well along with your permission allow me to grasp your feed to stay updated with impending post.
Thank you 1,000,000 and please carry on the gratifying work.

Post a Comment