Reputation: 1
I am using the below xpath expression to extract the String, its not working as expected anyone please help me out here
XPATH Exp:
XmlModule::xpath('/*:ExecuteXMLStringResponse/*:ExecuteXMLStringResult',payload.^raw,{})]"
Payload:
<?xml version="1.0" encoding="UTF-8"?>
<ExecuteXMLStringResponse xmlns="http://tempuri.org/">
<ExecuteXMLStringResult>
<?xml version="1.0"?><DCResponse><Status>Success</Status><Authentication><Status>FirstTimeLogIn</Status><Token>646d9300-7341-41a0-9c0f-05a40c3f2b94</Token></Authentication><ResponseInfo><ApplicationId>23429782</ApplicationId><SolutionSetInstanceId>b08cc093-c735-4435-b7b9-beef1c10dd23</SolutionSetInstanceId><CurrentQueue></CurrentQueue></ResponseInfo><ContextData><Field key="RiskClass">C</Field></ContextData></DCResponse></ExecuteXMLStringResult></ExecuteXMLStringResponse>
I am getting:
'¬í ava.util.ArrayListx �Ò ™ Ça � '
The above arraylist has to be converted into the required format.
Expected Output:
The whole String(As mentioned below) inside the tag
<?xml version="1.0"?><DCResponse><Status>Success</Status><Authentication><Status>FirstTimeLogIn</Status><Token>646d9300-7341-41a0-9c0f-05a40c3f2b94</Token></Authentication><ResponseInfo><ApplicationId>23429782</ApplicationId><SolutionSetInstanceId>b08cc093-c735-4435-b7b9-beef1c10dd23</SolutionSetInstanceId><CurrentQueue></CurrentQueue></ResponseInfo><ContextData><Field key="RiskClass">C</Field></ContextData></DCResponse>
Please help me in finding out the required output.
Upvotes: 0
Views: 1342
Reputation: 5059
Hi I would recommend to use directly dataweave instead of XPath.
%dw 2.0
output application/java
---
payload.ExecuteXMLStringResponse.ExecuteXMLStringResult
Upvotes: 3