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="http://www.bea.com/wli/sb/xpath/config">
    <xpf:category id="%OSB_FUNCTIONS%">
        <xpf:function>
            <xpf:name>customConcat</xpf:name>
            <xpf:comment>%FUNC_CUSTOM_CONCAT_COMMENT%</xpf:comment>
            <xpf:namespaceURI>http://nl.iteye/osb/custom/functions/OsbUtils</xpf:namespaceURI>
            <xpf:className>nl.iteye.osb.custom.functions.OsbUtils</xpf:className>
            <xpf:method>java.lang.String customConcat(java.lang.String, java.lang.String)</xpf:method>
            <xpf:isDeterministic>false</xpf:isDeterministic>
            <xpf:scope>Pipeline</xpf:scope>
            <xpf:scope>SplitJoin</xpf:scope>
        </xpf:function>
    </xpf:category>
</xpf:xpathFunctions>

Use

<xpf:name>customConcat</xpf:name>

instead of

<xpf:name>util:customConcat</xpf:name>

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”

commenter

{

{

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”

commenter

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 ?

commenter

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).
RequestA——Response
RequestB——Response
RequestC——Response
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.

commenter

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
Uday

commenter

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

commenter

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):
Website:
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>