IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

Passing Parametes to the XPath Function

  • 1.  Passing Parametes to the XPath Function

    Posted 07/31/15 03:55 PM

    Originally posted by: kumar.prashanth


    HI

     

    I am using the XPath function to lookup a value which is in a external XML file. The function works when I hardcore the value. But when I parameterise the value, The function is not working. Is there a way to send the value as a parameter to the function.

     

    For example.

    =XPATH("file:///C:/lookup.xml",  "/*/*/Code[@TranCode='DD' and @TellerNumber= '0001' and @AccountType='CHECKING']/code/text()" ,"http://baicode.com" ) works without any issues.

     

    But 

    =XPATH("file:///C:/lookup.xml",  "/*/*/BAICode[@TranCode="+In1+" and @TellerNumber= "+In2+" and @AccountType='CHECKING']/code/text()" ,"http://baicode.com" ) where In1 and In2 are field values it does not work. The XPATH lookup value is empty. 

     I have tried wrapping the values using TEXT and PACKAGE but without any luck, I have the following question

    1. Can we send the values as parameters to the XPATH function?
    2. Am i doing it correctly? If not can somebody guide me on the proper way of doing it.

    Thanks in Advance

    Prashanth

     

     

     


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: Passing Parametes to the XPath Function

    Posted 08/03/15 11:09 AM

    Originally posted by: Arun Ramamurthy


    Hi ,

     

    Did you make sure the passing parameter had the single quotes when passed?
     For example the following works:

     

    =XPATH("file:///C:\ipo.in.xml", "/ipo:purchaseOrders/order/items/item[@partNum=" + "'"+ Fld[1]:out1 + "'" +"]/productName", "ipo http://www.example.com/IPO" )

     

    Note : here "'" = single quote enclosed within double quotes ( double quote single quote double quote)

     the single quote had to be passed before and after the Fld[1]:out1.

     


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Passing Parametes to the XPath Function

    Posted 08/03/15 08:33 PM

    Originally posted by: kumar.prashanth


    Thanks Arun,

     

    I missed the single quotes and now its working. I am able to do the lookup and populate the field. Now I am having a issue where I am testing the the map on datapower and I have provided the location of the lookup file as local:///lookupfile.xml on the datapower and when I run the map, its gets executed but the field is not getting populated with the lookup values.  I am using the interoperability service within datapower to test the map.

     

    If i provide a windows file system path in the XPATH function and test the map using the data power interoperability service it works. But when i upload the lookup file on data power and provide the path to the file on the data power its not working.Any idea as to why the lookup is not happening when I provide the location of the lookup file as local:///lookupfile.xml?

     

    Thanks

    Prashanth


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: Passing Parametes to the XPath Function

    Posted 08/04/15 09:14 AM

    Originally posted by: Tim Rabbitt


    Hello Prashanth:


    What version of WTX are you using?  I'm asking because XPATH functionality was not added to the WTX/DataPower integration until 8.4.1.3

     

    http://www-01.ibm.com/support/knowledgecenter/SSVSD8_8.4.1/com.ibm.websphere.dtx.whatsnew.doc/topics/g_wnref_dtx_8413.htm

     

    Regards,

    Tim Rabbitt


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Passing Parametes to the XPath Function

    Posted 08/04/15 10:05 AM

    Originally posted by: kumar.prashanth


    Tim,

     

    We are using WTX 8.4.1.3 and Datapower is V7.1.0.4. Its working if I provide the Windows Path but not if i the path is on Datapower?The Maps will be deployed on Datapower Thats why I am using the path to a location on Datapower.

     

    Thanks

    Prashanth

     


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender