OSB: xquery as entry in xquery

Hello

I've stored an xml like xquery. SwA < customer > < name > < / name > < neh name > < / name > < / customer >
I wrote an other xquery (named result.xquery) that supports entry by top of xml and produced the result. ex: if (data($customer/name) = "swa" then "osb" other ")
I assign customer.xquery to a variable CLIENT and application processing of result.

Since my xml (customer.xquery) is static and only reside within the OSB, can I switch to result.xquery without him assigning to the CUSTOMER.

In short can I place a query as an input for xquery another xquery?


p.s.: Question may seem trivial, but in my case, I need to get pretty much static xmls in code and I am asked to not use the legend of java.

In short can I place a query as an input for xquery another xquery?

N ° you can not do.

I assign customer.xquery to a variable CLIENT and application processing of result.

In fact when you assign an XQuery in variable then OSB internally executes the XQuery query and assigns the output of XQuery to the variable. If your variable does not actually hold the reference of the XQuery function rather it contains the XQuery output which you pass as input to other XQuery.

You might want to store the mappings in DB and result caching functionality with the JCA DB BS adapter allows to recover the value of mapping during execution.

Kind regards
Anuj

Tags: Fusion Middleware

Similar Questions

  • Replace a string in the data of the element - OSB / Xquery

    I want to replace a string in a piece of XML data in OSB/XQuery. Pls help me... (by something in the XPATH expression or actions of the OSB)

    Scenario looks like - I want to remove "IND_" of the field type in the code xml.

    Input XML (OSB or XQuery) - stored in a variable say $cricInfo

    < CricInfo >
    < player >
    < drive >
    Sachin < name > < / name >
    * < Type > IND_BAT < / name >. *
    < / player >
    < drive >
    Barouk < name > < / name >
    < Type > IND_BOWL < / name >
    < / player >
    < drive >
    Dhoni < name > < / name >
    WK of < type > < / name >
    < / player >
    < / players >
    < / CricInfo >

    Output XML file

    < CricInfo >
    < player >
    < drive >
    Sachin < name > < / name >
    < * type > BAT < / name >. *
    < / player >
    < drive >
    Barouk < name > < / name >
    BOWL of < type > < / name >
    < / player >
    < drive >
    Dhoni < name > < / name >
    WK of < type > < / name >
    < / player >
    < / players >
    < / CricInfo >

    Best regards, Sesha

    may also adapt the 'identity Transform' to do some filtering on the item 'type ':

    Here the transformation of base:

    http://en.Wikipedia.org/wiki/Identity_transform#Using_XQuery

    at least you would avoid having to reproduce the overall structure of the document in your XQuery, which is always a Bad Thing (TM)...

    by the way, your XML file is not well formed, I fixed it here


    Sachin
    IND_BAT


    Barro
    IND_BOWL


    Dhoni
    WK


  • OSB - XQuery - line 7, col 2: {err} FORG0005: expected exactly 1 article, 0

    Hello

    I am trying to run sample XQuery below. The eclipse designer shows no error. However, the performance of the XQuery, I get the following error "+ XQuery transformation runtime error: line 7, column 2: {err} FORG0005: expected exactly one item, items 0 +". Appreciate your help.


    XQuery version "1.0" encoding "UTF - 8";

    declare namespace xf = "http://tempuri.org/OSB%20Project%201/Ids/";

    declare function:Ids() xf
    element () {*
    * Let $abc: = < catalog > < product dept = 'MAN' > < number > 784 < / number > < name language = "fr" > cotton shirt < / name > < colorChoices > grey white < / colorChoices > < desc > our favorite shirt! < / desc > < / product > < / catalogue > *.

    for the $product to $abc/catalog/product *.
    * Let $name: = $product / name *.
    * where $product/@dept = "VAC."
    * order by $name *.
    * return $name *.
    *};*

    XF:IDS()

    Ah, I only saw that the first product.

    Yes, other products have no namespace, this is why there is no match.
    If you set the namespace in the world they come back.

  • OSB - XQuery - line 24, col 1 {err} FORG0005: expected 1 article, 2 or mor

    In the below XQ, I'm learning calls to local functions. I tweaked my previous XQ, who had a local variable defined [based on the xf:getCost ()] XPath to the amount. Now, I changed the XQ to do a call to xf xf:getCost:getQty() (), to get the desired amount.

    The performance of the code below, I get
    error has occurred during execution of XQuery: line 24, column 1: {err} FORG0005: exactly waits for a time, got 2 + points. Either the XQuery query is invalid or...
    Ask for help
    xquery version "1.0" encoding "Cp1252";
    (:: pragma parameter="$anyType1" type="xs:anyType" ::)
    (:: pragma type="xs:anyType" ::)
    
    declare namespace xf = "http://tempuri.org/purchaseOrder/";
    
    declare function xf:getCost()
    as xs:double {
    let $po := <purchase-order>
    <red-tape/>
    <order-item product="p010" price="10.50" quantity="3"/>
    <order-item product="p020" price="18.10" quantity="8"/>
    <order-item product="p020" price="11.10" quantity="8"/>
    </purchase-order>
    
    let $s1 := $po/order-item/@price
    let $s2 := $po/order-item/@quantity
    let $s3 := sum(for $el at $i in $s1 return $s1[$i] * xf:getQty($i))
    return $s3
    };
    
    declare function xf:getQty($index as xs:decimal)
    as xs:decimal {
    let $po := <purchase-order>
    <red-tape/>
    <order-item product="p010" price="10.50" quantity="3"/>
    <order-item product="p020" price="18.10" quantity="8"/>
    <order-item product="p020" price="11.10" quantity="8"/>
    </purchase-order>
    
    return ($po/order-item/@quantity[$index])
    };
    
    xf:getCost()

    return ($po/order-item[$index]/@quantity)

    not

    return ($po/order-item/@quantity[$index.)

  • Xquery functions using predefined in user defined functions

    Hi all

    I have a requirement to call a function defined by the user in the osb xquery file. That function, I use osb predefined string functions, but they do not work it displays the error message in the file of xquery. Can you please suggest how to use user-defined functions.

    Thank you
    Srinivas.
    xquery version "1.0" encoding "Cp1252";
    
    declare namespace xf = "http://tempuri.org/TransactieService/Xquery/test/";
    
    declare function xf:test($string1 as xs:string)
        as xs:string {
            xf:buildReferenceRange($string1)
    };
    
    declare function xf:buildReferenceRange($inRange as xs:string)
         as xs:string {
         let $filtered :=
              if (contains($inRange,"^"))
              then
                   "it's in"
              else
                   "it's not in"
    
         return $filtered
    }; 
    
    declare variable $string1 as xs:string external;
    
    xf:test($string1)
    

    It works for me

  • exhib CDATA in OSB

    Hello

    I have an incoming message that has inside CDATA tag...

    Y at - it an easy way of stip the CDATA and simply return the raw xml data?

    I tried a few osb/xquery replace... but it doesn't seem to work...

    [OSB tracing] Enter the stadium stage1 with the context of the message:
    [MessageContextImpl body = "< soapenv:Body xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' > <!"] [CDATA [< PURCHASE_ORDER_150 partner = "XXX" transaction = "PURCHASEORDER" version = "1.50" timestamp = "' 2011-04 - 19 T 10: 36:55"... "]]
    .. "[[._QTY_ORDERED > < / CONTROL > < / PURCHASE_ORDER_150 >]] > < / soapenv:Body >.

    Thank you
    Ganesh

    Ganesh is the type of service "No matter what XML"?

  • OSB: xpath as a result of the XQuery output?

    Hello

    I have a related XML non-schema as input. Value of one of the tags will be 'KEYWORD'.
    I want a dynamic text 'Hello' instead of the KEYWORD.
    From now I convert XML to a string with fn - bea: serialize() and then create a fn: replace.

    Viz:
    Let $received_input: = KEYWORD < C > < D >/< d: > < / c >
    Let $convertedXML: = fn-serialize ($received_input)
    Let $temp_string: = fn:replace($convertedXML,"KEYWORD","hello")
    Let $final_output: = fn - bea:inlinedXML ($temp_string)
    return $final_output

    Now, notice that the xml entry still varies as * < Z > keyword / < z > * or keyword < B > < C > < D >/< d: > < E > keyword < /E > < / c > < / b > or anything, only 'KEYWORD' will be there for you.

    Because xml input varies, I don't have a diagram. What if I want to use to replace action by node contained in the variable received_input? I need to calculate the xpath of the node that has the value = KEYWORD. It is a dynamic calculation of xpath.

    I wonder if there is a feature of xquery that I could use in OSB for this? Basically idea is to contribute a value and function returns the xpath of the node which conntains the value.


    Thanks and greetings
    Patricia Kharwadkar

    Hi Patricia Kharwadkar,.

    You can do what you want using plain xpath...

    $input =

    
    b
    keyword
    d
    keyword
    
    

    $value = "Hello".

    Replace the Xpath = / / * [. = 'keyword'] variable = expression of $input = $value (replace content of the node) will give you...

    
    b
    hello
    d
    hello
    
    

    This works for any schema that the xpath expression is looking for content only.

    I hope this helps...

    See you soon,.
    Vlad

  • XQuery error during the action replace is OSB

    Hi, I am trying to replace the body of the OSB with an xquery but its seems I have a typo somewhere... issue or namespaces, but I can not understand. The error I get is:
    OSB Replace action failed updating variable "body": Error parsing XML: {err}XP0006: "element {http://www.w3.org/2003/05/soap-envelope}Header { {http://www.w3.org/2004/07/xpath-datatypes}untypedAny }": bad value for type element {http://schemas.xmlsoap.org/soap/envelope/}Header { {http://www.w3.org/2001/XMLSchema}anyType }
    My xquery looks like:
    (:: pragma bea:global-element-parameter parameter="$soapheader" element="soap-env:Header" location="soap-env.xsd" ::)
    (:: pragma bea:global-element-parameter parameter="$soapbody" element="soap-env:Body" location="soap-env.xsd" ::)
    (:: pragma bea:global-element-parameter parameter="$osbfault" element="ctx:fault" location="MessageContext.xsd" ::)
    (:: pragma bea:global-element-parameter parameter="$osbinbound" element="ctx:endpoint" location="MessageContext.xsd" ::)
    (:: pragma bea:global-element-return element="ns0:Error" location="../../cdm/1.0/TechnicalTypes.xsd" ::)
    
    declare namespace http = "http://www.bea.com/wli/sb/transports/http";
    declare namespace ns0 = "http://www.mycompany.com/schema/technical";
    declare namespace tp = "http://www.bea.com/wli/sb/transports";
    declare namespace ctx = "http://www.bea.com/wli/sb/context";
    declare namespace xf = "http://www.roceindhoven.nl/common/faulthandling/";
    declare namespace soap12-env = "http://schemas.xmlsoap.org/soap/envelope/";
    
    declare function xf:handleFault(
        $soapheader as element(soap12-env:Header),
        $soapbody as element(soap12-env:Body),
        $osbfault as element(ctx:fault),
        $osbinbound as element(ctx:endpoint))
        as element(ns0:Error) {
            <ns0:Error>
                <ns0:ErrorId>{ data(fn-bea:uuid()) }</ns0:ErrorId>
                <ns0:ErrorDate>{ data(fn:current-dateTime()) }</ns0:ErrorDate>
                <ns0:ErrorOrigin>
                     <ns0:Server>{ data($osbinbound/ctx:transport/ctx:request/tp:headers/http:Host)}</ns0:Server>
                     <ns0:Component>{ data($osbinbound/ctx:transport/ctx:uri) }</ns0:Component>
                </ns0:ErrorOrigin>
                <ns0:ErrorCode>{ data($osbfault/ctx:errorCode) }</ns0:ErrorCode>
                <ns0:ErrorDescription>{ data($osbfault/ctx:reason) }</ns0:ErrorDescription>
                <ns0:ErrorDetail>{ fn-bea:serialize($osbfault/ctx:details)}</ns0:ErrorDetail>
                <ns0:Message>
                    <ns0:Header>{ fn-bea:serialize($soapheader)}</ns0:Header>
                    <ns0:Body>{ fn-bea:serialize($soapbody)}</ns0:Body>
                </ns0:Message>
            </ns0:Error>
    };
    
    declare variable $soapheader as element(soap12-env:Header) external;
    declare variable $soapbody as element(soap12-env:Body) external;
    declare variable $osbfault as element(ctx:fault) external;
    declare variable $osbinbound as element(ctx:endpoint) external;
    
    xf:handleFault($soapheader,$soapbody,$osbfault,$osbinbound)
    as an entry for my xquery, I use the variables $header, $body, $fault and $inbound.

    Can someone tell me what is the problem?

    XML parsing error: {err} XP0006: "{http://www.w3.org/2003/05/soap-envelope} header element {{http://www.w3.org/2004/07/xpath-datatypes} untypedAny} ': good value for type {http://schemas.xmlsoap.org/soap/envelope/} header {anyType {http://www.w3.org/2001/XMLSchema}}

    It looks like you spend a soap 1.2 from the pipeline, header while your xquery is configured to accept the 1.1 header...

    Try to change the namespace declaration:
    declare namespace soap12-env = "http://schemas.xmlsoap.org/soap/envelope/"; to declare namespace soap12-env = "http://www.w3.org/2003/05/soap-envelope".

  • From XQuery and OSB

    Hello
    I'm new to OSB, can someone please help me give me a few entries to learn XQuery and OSB?

    Thanks in advance.

    Ankit

    Hello

    For the W3C.

    "[http://www.w3schools.com/xquery/default.asp]".
    "[http://www.w3.org/XML/Query/]".

    and for the BSO

    [http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/tutorial/tutGettingStarted.html]
    [http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/index.html]

  • converting string to XML using Xquery transformation in OSB node

    How to convert the string to XML node elementusing built in function by using Xquery transformation in OSB?

    Discover this - http://www.javamonamour.org/2011/06/fn-beainlinedxml.html

    If in SOA (BPEL & mediator), you can use oraext:parseXML.

    You must analyze in depth where to implement your requirement as some good practices advise to implement logic more complex in SOA and let OSB only connect to endpoints of services.

    Hope this helps,

    A.

  • OSB - how to preserve start and end spaces in Xquery

    I am using Xquery to fill with spaces "to meet a standard of length.

    Example: If set criteria of length = 7, data = 'abcd' result 'abcd '.

    While working with Eclipse, Xquery - Test shows results with sapces but when I test Xquery in SbConsole, is to show that a single space.

    And while publishing to the target database the $body variable removes this one space too.

    I tried using XML: Space = "preserve" for the top node, but it does not work.

    I use 11.1.1.5 eclipse and 11.1.1.5 OSB.

    Please help me solve this problem.

    A resolved. Issues with the browser rather than xml.

    ProxyService

         {fn:concat("","Hello")}
         {data (fn:concat("","Hello"))}

    SbConsoleTest: Showing only one workspace

         Hello
         Hello

    HTML page: View Source
    XML: Space="preserve"> Hello< /Test1>
    <Test2> Hello< /Test2>

  • Insertion of DB OSB using XQUERY

    Hi all

    How can insert us records in the database of the OSB outside the JCA adapter.

    We can do this via XQUERY using functions, any help in this matter will be very useful

    Thank you

    Go pls thro this
    FN - bea: sql performance with 'Insert INTO' SQL statement

    FN - bea: execute - sql () is a read-only function. I'm afraid to go only wit JCA

  • OSB/ALSB: xquery processing

    Hello

    I have xml of the form:

    namespaceA = "www.school.com/school."
    namespaceB = "www.teacher.com/teacher".

    < namespaceA:School >
    < namespaceA: Class > 10th < / namespaceA: Class >
    < namespaceB:Teacher > John < / namespaceB:Teacher >
    < / namespaceA:School >

    I want to extract the element of class <>, then in xquery, I simply write expression and assign it to the variable:

    $body / namespaceA:School / namespaceA: Class this expected result is the following: * < namespaceA: Class xmlns:namespaceA = "www.school.com/school" > 10th < / namespaceA: Class > *.

    However, I get the following:

    < namespaceA: Class xmlns:namespaceA = "www.school.com/school" xmlns:namespaceB = "www.teacher.com/teacher" > 10th < / namespaceA: Class >

    Now clearly I have no statement B space in the resulting < class > subelement.

    How to stop the legacy of these namespaces? I used expression: $body/namespaceA:School/@*, $body / namespaceA:School/node() but in vain.

    Any ideas?

    If you can ignore it, just ignore it. If it irritates you really, here located in the OSB how to remove namespace in the you have some solutions - I have not tried, so it is up to you to experiment.

  • OSB: Lock the table of database through xquery

    Hello

    How to lock the database using xquery in OSB?
    I tried the following:

    declare namespace xf = "http://tempuri.org/OSBProject1/xquery/lookup/";
    declare function xf:lookup() as element (*)
    {fn - bea: execution-sql (' jdbc/BankDataSource', 'rec', 'TABLE LOCK BANK IN EXCLUSIVE MODE')}
    };
    XF:Lookup()

    He threw the error:

    The transformation of XQuery runtime error: line 3, column 4: {bea - err} RDBW0019: [jdbc/BankDataSource]: [LOCK TABLE BANK IN EXCLUSIVE MODE]: SQL query execution error. The query result is not in a table (set of expected results, a '0')

    What to do? This is urgent. pls help!

    You can perform operations read-only by using this function.

  • Problem with Xquery transformation in OSB

    Hello

    My scenario is that I divides the data into a single XML A tag, to fill several tags XML B.I uses the transformation and the substring of Xquery function to achieve. The problem comes when I import the resource xquery in OSB and try to make the transformation in a proxy service, it gives the following error

    < con xmlns:con: fault = "http://www.bea.com/wli/sb/context" >
    < con: errorCode > BEA-382510 < / con: errorCode >
    < con: reason >
    * OSB Assign action failed 'message' variable updated: com.bea.wli.common.xquery.XQueryException: XML parsing error: {err} XP0006: "Body {http://schemas.xmlsoap.org/soap/envelope/} element {{http://www.w3.org/2004/07/xpath-datatypes} untypedAny} ': good value for the data element type {http://www.example.org/data} {{http://www.w3.org/2001/XMLSchema} anyType} *.
    < / con: reason >
    < con: location >
    < con: node > PipelinePairNode1 < / con: node >
    < con: pipeline > PipelinePairNode1_request < / con: pipeline >
    stage1 < con: Stadium > < / con: Stadium >
    request pipeline - < con: path > < / con: path >
    < / con: location >
    < / con: fault >


    the configuration that I made in the proxy service is the following:_


    Assign: [XQuery resources..] to [message]

    Delete: [..] in [body]

    Insert [$message] [as a first child of] [..] in [body]


    The resource of Xquery is the .xq file I generated for the transformation of Xquery.
    and I m routing this proxy service to a business service that take wud XML and throw on my D drive using the file protocol.

    Published by: rahulc on October 12, 2010 12:40 AM

    Published by: rahulc on October 12, 2010 12:41 AM

    $body means not don't FORGET ME THIS weekend! but $body / * means don't FORGET not ME THIS weekend!

    Kind regards
    Anuj

Maybe you are looking for