Custom Xpath function in Oracle Service Bus
package com.ankur.blogs;
public class CustomXPathFunctions {
public CustomXPathFunctions() {
super();
}
public static String greeting(String name){
return “Hi “+name;
}
}
The above XML fragment shows the custom XPath function name(Gretting), Class name (CustomXPathFunctions) , Java Method(greeting).
Compile the java class. Create a folder META-INF and put the custom-osb-xpath.xml under META-INF folder.
Folder structure will look like:
Now create a .jar file. Open command prompt and move to the directory where we kept the above file and run the below command:
jar -cf customxpath.jar .
Copy the custompath.jar and custom-osb-xpath.xml to $OSB_HOME/config/xpath-functions directory, and copy the custompath.jar to $DOMAIN_HOME/lib directory.
Restart the Jdeveloper and Servers.
Let’s create a simple XSLT and search the greeting functions from the component pallet:
You can drag the greeting function from component pallet to the middle pane of the XSLT:
This is the time to test the XSLT
You can see, Hi has been appended to the name, that’s mean custom xpath function has been called successfully.
Done!
Very nice blog. This really helped me out 🙂
I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article… personalizar tu reloj
Thankyou for sharingerp software companies