Importing SOA 11g standard XPath Functions into OSB 11g

Ok, so heres the problem. OSB 11g and SOA 11g XPath functions are not in Sync.  So, XSLTs that were developed in SOA 10g cannot be used directly in OSB 11g. One of the strong cases for this is the migration of all ESB based artifacts to OSB artifacts.

One of the easiest  ways of doing  this is to take all the xpath functions that are defined in the soa-xpath-exts.jar and soa-xpath-functions-config.xml and dump em into OSB XPath config as a Custom XPath. Here are the steps:

1. Get the fabric-runtime.jar and the soa-xpath-exts.jar from %SOA_HOME%\soa\modules\oracle.soa.fabric_11.1.1

2. Get the soa-xpath-functions-config.xml from %JDEVELOPER_HOME%\jdeveloper\integration\seed\soa\configuration. This file contains a list of all the XPath functions. We wont do anything to this….just for reference.

3. Now, get the osb-built-in.xml and files from%OSB_HOME%\config\xpath-functions. Create copies of these files. We will modify these copies to include the migrated XPath Functions.

4. Now the task is to map the XPath functions defined in soa-xpath-functions-config.xml to the copy of the osb-built-in.xml that you just built. Almost for all the XPaths the only thing that needs to be changed is <xpf:name>,<xpf:comment>,<xpf:namespaceURI>,<xpf:className> and the <xpf:method>. Rest of the elements can be safely kept as is. The mentioned five elements can be directly mapped from the soa-xpath-functions-config.xml. But note that OSB XPath functions doesnt support inner classes and there are a hell lot of inner classes in the soa-xpath-functions-config.xml. So inorder to get over this, you have to somehow get the source code of the custom xpath functions, check which method of a particular class gets called and use that in the <xpf:className> and the <xpf:method>.

5. Make sure you know the permitted java types when you specify the <xpf:method> as in the document: Some of the methods cannot be used !!!

6. Also make sure that for each XPath defined in the copy of the osb-built-in.xml you have to specify the comments in the proeprties file as well.

7. After you are done, dump all the jars and the OSB custom XPath files into %OSB_HOME%\config\xpath-functions.

This is a lot of pain.. and it would definitely take a good 8 hours!!!

Anywayz, if you dont want to do all this re-engineering, you alternatively use the Nirvana package below 🙂 This package contains support for the XPaths listed here

Unzip the folder and copy everything to %OSB_HOME%\config\xpath-functions . Restart Weblogic and Workshop. Follow the Installation Instructions in the reference for more details.

XPath Nirvana is here!!!

These XPath functions have the same name as the standard SOA 10g functions, although the namespaces are different.

The usage of these functions are different for XSLT and XQuery.

  1. XQuery: The XPath functions listed in the table should be used alongwith the necessary namespaces. This means that you can directly drag from the Expressions window.
  2. XSLT: For use in XSLT expressions, the Java Method name of the custom XPath function should be used alongwith the necessary namespaces.


Note the difference in usage for the format-date XPath in XQuery and XSLT:


<Result><formatDate>dat:format-date(‘2028-08-31T05:30:54+05:30′,’yyyy.MM.dd G HH:mm:ss z’)</formatDate></Result>


<xsl:stylesheet version=“1.0” xmlns:xsl=; xmlns:dat=;><xsl:template match=“/”>

<Result><formatDate><xsl:value-of select=dat:formatDate(‘2028-08-31T05:30:54+05:30′,’yyyy.MM.dd G HH:mm:ss z’)” /></formatDate></Result>


The full list of namespaces for each XPath can be found in here.


1. Custom XPath Functions Library

2. Installation Manual for Custom XPath Functions Library

3. Full List of Supported XPath Functions

3 Responses to “Importing SOA 11g standard XPath Functions into OSB 11g”
  1. Augustin Mateica says:

    Hi Sandeep,
    Great post you did.
    Do you know if i could import DVM:LookupValue xpath into OSB 11g?
    I took a look in bpm-service.jar and i couldn’t found Class responsible for that …

    Please reply my on

    Thank you,

  2. ebru says:

    Hi Sandeep,
    i have copied all the files listed in the installation document under \Oracle_OSB1\config\xpath-functions and inserted the line xmlns:dat=”” in the Jdev generated xslt file. but i have realised that when i try to access from the browser i cannot connect the site. Neither my xslt works on OSB, i am getting OSB Replace action failed updating variable “body”: java.lang.NoSuchMethodException: For extension function, could not find method weblogic.apache.xpath.axes.WalkingIteratorSorted.format-date([ExpressionContext,] #STRING). error.
    Can you please recommend me anything that i can make my xformation work.

  3. gusthy says:

    Hi, Sandeep,

    I would like to use lookupXref, but I don’t know, how to specify the URI of the xref itself. (lookupXref wants to look after the MDS for reaching the appropriate xref file.

    Can you please help me?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: