Reputation: 137
In my BIP RTF template i am receiving a string in a parameter(say Clinic) and in the IF condition i have to match the parameter($Clinic) with the XML tag (ssRohClinicFacilityName).
Now problem is, incoming parameter is as a truncated string and for a accurate match we have to append a string with the parameter like below:
$Clinic + " Clinic"
As reports are being generated from Siebel application so there is a limiation on Siebel side on the number of characters to be sent in the parameters.
To achieve above requirement I tried multiple options but none worked for me yet.
I have tried following so far:
Tried to do concatenation . This is worked as it is but i am not sure how can i use it in the IF condition with the other existing conditions. When i try following i get error.
= (xdoxslt:format_date($StartDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE)) and (xdoxslt:format_date(ssAssignmentDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE)))?>I tried using XSLT:Subscrting to truncate the ssRohClinicFacilityName but i needed something like this xdoxslt:substring(ssRohClinicFacilityName, length(ssRohClinicFacilityName)-7, length(ssRohClinicFacilityName)) = $Clinic)
as I only have to truncate last 07 characters but could not found relevant functions
Here is my existing if condition:
<?if:( xdoxslt:format_date(ssAssignmentDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE))>= (xdoxslt:format_date($StartDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE)) and (xdoxslt:format_date(ssAssignmentDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE))<= (xdoxslt:format_date($EndDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE))?>
Upvotes: 0
Views: 7298
Reputation: 1589
I think it will be easier for you if you just use wildcards for the comparison.
Refer: https://blogs.oracle.com/xmlpublisher/wildcards
& https://www.quackit.com/xml/tutorial/xpath_string_functions.cfm
You could search for
starts-with(ssRohClinicFacilityName, $Clinic)
--New content---
It can be used with and if function, or even without. Here is what I tried:
And here are the results.
<?starts-with(ssRohClinicFacilityName, $Clinic)?>
With an if condition
<?if:starts-with(ssRohClinicFacilityName, $Clinic)?>
'MATCHED'
<?end if?>
I suggest you try testing this part separately, there could be other errors in the if statement which is causing incorrect output.
Upvotes: 0