Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

12c SOA BPEL - How to convert string to NodeSet

Srinanda DasFeb 17 2020 — edited Feb 28 2020

12c SOA BPEL - How to convert string to NodeSet:

I have a string variable which contains the following:

<?xml version="1.0" encoding="UTF-8"?><CityDetails>

   <CityDetails>

      <CityCode>KOL</CityCode>

      <State>WesBengal</State>

      <Capital>Kolkata</Capital>

   </CityDetails>

</CityDetails>

I want to assign these fields values to output xml elements. I did simple assign as following:

    <assign name="Assign1">

      <copy>

        <from>dvm:lookupValue1M('DVM/CityDetails.dvm','CityName',$inputVariable.payload/ns2:cityName,'CityCode','State','Capital')</from>

        <to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">$CityDetails</to>

      </copy>

    </assign>

    <assign name="Assign2">

      <copy>

        <from>$CityDetails/CityCode</from>

        <to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">$outputVariable.payload/ns2:cityCode</to>

      </copy>

      <copy>

        <from>$CityDetails/State</from>

        <to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">$outputVariable.payload/ns2:state</to>

      </copy>

      <copy>

        <from>$CityDetails/Capital</from>

        <to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">$outputVariable.payload/ns2:capital</to>

      </copy>

      <copy>

        <from>$inputVariable.payload/ns2:cityName</from>

        <to expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">$outputVariable.payload/ns2:cityName</to>

      </copy>

    </assign>

Received below error:

<faultcode>env:Server</faultcode>

<faultstring>An error occurs while processing the XPath expression; the expression is $CityDetails/CityCode</faultstring>

<faultactor/>

<detail>

<exception>XPath expression failed to execute.

An error occurs while processing the XPath expression; the expression is $CityDetails/CityCode.

The XPath expression failed to execute; the reason was: Cannot convert string to NodeSet.

Check the detailed root cause described in the exception message text and verify that the XPath query is correct.

</exception>

Please suggest how to convert from string to nodeset.

Thanks in advance.

Comments
Post Details
Added on Feb 17 2020
22 comments
3,336 views