How to use ora:parseEscapedXML() Function with String Content
438800Apr 29 2005 — edited Feb 5 2009Hello,
I am receiving a ResponseMessage that returns a string, but the content of the string is actually XML. I have tried to use the ora:parseEscapedXML() function to parses the string (see XML Fragment below) to return structured XML data that can be assigned to typed BPEL variables. The documentation is very limited for this (I've looked in the Developer Guide draft that is available at the OraBPEL site).
2 customer records from XML literal fragment copied from string result:
<?xml version="1.0" encoding="ISO-8859-1"?>
<recordset>
<customer>
<CustNum>AROUT</CustNum>
<CustLName>Hardy</CustLName>
<CustFname>Thomas</CustFname>
<CustEmail>Thomas.Hardy@Around.com</CustEmail>
<CustAddress>120 Hanover Sq.</CustAddress>
<CustCity>London</CustCity>
<CustRegion></CustRegion>
<CustPostalCode>WA1 1DP</CustPostalCode>
<CustCountry>UK</CustCountry>
</customer>
<customer>
<CustNum>BSBEV</CustNum>
<CustLName>Ashworth</CustLName>
<CustFname>Victoria</CustFname>
<CustEmail>Victoria.Ashworth@B's.com</CustEmail>
<CustAddress>Fauntleroy Circus</CustAddress>
<CustCity>London</CustCity>
<CustRegion></CustRegion>
<CustPostalCode>EC2 5NT</CustPostalCode>
<CustCountry>UK</CustCountry>
</customer>
The copy rule for assigning CustNum to accountnumber that fails:
<copy>
<from expression="ora:parseEscapedXML(bpws:getVariableData('DataService_OutputVariable','invokeSpecMsgReturn','/recordset/customer/CustNum'))"/>
<to variable="outputVariable" part="payload" query="/client:QueryResult/client:customer/client:accountNumber"/>
</copy>
Any help would be greatly appreciated.
Thanks,
Sean