I am learning java. I am unable to parse the below XML using Java. Could someone explain me how to parse this xml?
Even i have tried with some sample code. That didn't work. I want to read all the present under transaction tag with
Transaction Id
amount
- requestedAmount
- status
- Wallet Details
<?xml version="1.0" encoding="UTF-8"?>
<ns2:getFundAccountHistoryResponse xmlns:ns2="http://schema.products.sports.bet.com/fundingService" xmlns="http://schema.products.sports.bet.com/promoCommonTypes" xmlns:ns3="http://schema.products.sports.bet.com/fundingTypes">
<ns2:status code="OK" />
<ns2:transactions>
<ns3:transaction id="74608009" amount="-200.00" requestedAmount="-200.00" status="COMPLETE">
<ns3:wallets>
<ns3:wallet>
<ns3:walletType>NON_WITHDRAWABLE</ns3:walletType>
<ns3:totalBalance>0.00</ns3:totalBalance>
</ns3:wallet>
</ns3:wallets>
<ns3:transactionFunds>
<ns3:transactionFund>
<ns3:externalFundRef id="CPM-1073070" provider="OB.CUST" />
<ns3:transactionFundItems>
<ns3:transactionFundItem forfeited="false">
<ns3:type>CASH</ns3:type>
<ns3:amount>-200.00</ns3:amount>
</ns3:transactionFundItem>
</ns3:transactionFundItems>
</ns3:transactionFund>
</ns3:transactionFunds>
<ns3:transactionType>BSTK</ns3:transactionType>
<ns3:creationDate>2019-08-10T17:44:31</ns3:creationDate>
<ns3:publishedTransactionDate>2019-08-10T17:44:31</ns3:publishedTransactionDate>
<ns3:transactionDate>2019-08-10T17:44:31</ns3:transactionDate>
<ns3:fundingActivity>
<ns3:externalActivityRef id="60077338_0" provider="OB.BET" />
<ns3:type>STAKE</ns3:type>
<ns3:fundingOperations>
<ns3:fundingOperation>
<ns3:externalOperationRef id="b703c6b9-b9aa-4c5d-b6cc-1321d7f2a7a9" provider="OB.BET" />
<ns3:operationType>ESB</ns3:operationType>
<ns3:status>OPEN</ns3:status>
</ns3:fundingOperation>
</ns3:fundingOperations>
</ns3:fundingActivity>
<ns3:description>|Gold Coast Titans| @ 4.75</ns3:description>
</ns3:transaction>
<ns3:transaction id="74606629" amount="-411.00" requestedAmount="-411.00" status="COMPLETE">
<ns3:wallets>
<ns3:wallet>
<ns3:walletType>NON_WITHDRAWABLE</ns3:walletType>
<ns3:totalBalance>0.00</ns3:totalBalance>
</ns3:wallet>
</ns3:wallets>
<ns3:transactionFunds>
<ns3:transactionFund>
<ns3:externalFundRef id="CPM-1033856" provider="OB.CUST" />
<ns3:transactionFundItems>
<ns3:transactionFundItem forfeited="false">
<ns3:type>CASH</ns3:type>
<ns3:amount>-14.04</ns3:amount>
</ns3:transactionFundItem>
</ns3:transactionFundItems>
</ns3:transactionFund>
<ns3:transactionFund>
<ns3:externalFundRef id="CPM-1073070" provider="OB.CUST" />
<ns3:transactionFundItems>
<ns3:transactionFundItem forfeited="false">
<ns3:type>CASH</ns3:type>
<ns3:amount>-396.96</ns3:amount>
</ns3:transactionFundItem>
</ns3:transactionFundItems>
</ns3:transactionFund>
</ns3:transactionFunds>
<ns3:transactionType>BSTK</ns3:transactionType>
<ns3:creationDate>2019-08-10T17:42:08</ns3:creationDate>
<ns3:publishedTransactionDate>2019-08-10T17:42:08</ns3:publishedTransactionDate>
<ns3:transactionDate>2019-08-10T17:42:08</ns3:transactionDate>
<ns3:fundingActivity>
<ns3:externalActivityRef id="60076164_0" provider="OB.BET" />
<ns3:type>STAKE</ns3:type>
<ns3:fundingOperations>
<ns3:fundingOperation>
<ns3:externalOperationRef id="9700030e-8057-4ca4-8a1f-74ba9799980d" provider="OB.BET" />
<ns3:operationType>ESB</ns3:operationType>
<ns3:status>OPEN</ns3:status>
</ns3:fundingOperation>
</ns3:fundingOperations>
</ns3:fundingActivity>
<ns3:description>|Over| (49.0) @ 1.87</ns3:description>
</ns3:transaction>
</ns2:transactions>
</ns2:getFundAccountHistoryResponse>
I would like to print all the details of under transaction tag.