Oracle Service Bus custom xpath functions, prefix not defined in static context

When defining the new custom xpath functions for use in the service bus make sure you don’t prefix the name of the function you want to use

<?xml version="1.0" encoding="UTF-8"?>
<xpf:xpathFunctions xmlns:xpf="">
    <xpf:category id="%OSB_FUNCTIONS%">
            <xpf:method>java.lang.String customConcat(java.lang.String, java.lang.String)</xpf:method>



instead of


no namespace prefix on the name

Otherwise on designtime you will receive some error message like :

!MESSAGE [Error Handler, FinalErrorHandler, Assign action] XQuery expression validation failed: line 6, column 32: {err}FONS0003: "func4": prefix not defined in static context
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

7 Responses to “Oracle Service Bus custom xpath functions, prefix not defined in static context”




if (fn:contains (data($MethodResponseActivation), ‘not’ ))
then 1

Everytime a declare a path to retrieve the value “1” using the following path :

$statusCode1/ctx:route/ctx:status/code:statuscode ….

I get the following error:

prefix not defined in static context for “code”


did you add the namespace ‘code’ ?
when you use assign/replace/etc at the right of the window/popup you have an option to show all the current added namespaces, is your there ?


Hi Eric,
I have a requirement like three different requests all are converted in to standard format.For this scenario I use dyamic X-query transformation.For Example RequestA,RequestB and RequesrC what ever request it should be converted into one standard format say Response.For this I create three X-Query transformations,and proxy service.If i get the request from RequestA related XQuery will execute (RequstA to Response transformation).
Actually my idea is based on requset schema name (like RequestA) it will convert,for this scenario how can I set condition in dynamicXquery.

Thanks in advance.


Hi Eric,

In Project i am using Xquery function in that i am using dvmlookup funtion :soanM:lookupValue($dvm1,$CollegeCode,’CollegeCode’,’CollegeName’,’N/A’) but when i was trying to run it… it is giving an error : error occurred while executing xquery: line 11,column 32: {err}FONS0003:”soanM”:Prefix not defined in static context.
Either the Xquery is invalid or it contains custom xquery functions. can you please help me out in this… It helps me a lot

Thanks in advance


Do you run/test it locally or on runtime from within your MessageFlow ?


First i trying to test .xq in Eclipse it self…
When i was trying to test it in “Result Data” i am getting that ErrorMessage…

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>