K
K
Konstantin Zhikhor2020-02-20 09:44:17
PHP
Konstantin Zhikhor, 2020-02-20 09:44:17

How to parse xml document?

Tell me please. How can I parse this xml string?

<?xml version="1.0" encoding="UTF-8"?>
<PropertySet>
  <receiveCreditDecision:parameters>
    <ListOfcred:receiveCreditDecision>
      <cred:receiveCreditDecision>
        <ListOfdecision>
        <decision
         source="OTPBank"
         downPayment=""
         limitCartOfGoods="100000"
         decision="1"
         AgentServicesAmount="0"
         monthlypaymentamount="0"
         environmentCode="KREDBRKMNG_TEST"
         amount="0"
         referenceKB=""
         reference="2-18NA3A7L"
         FullAgentServicesAmount="0"
         product="PKP285_̶_36"
         CreditAmount="0"
         creditTerm="15"></decision>
        </ListOfdecision>
      </cred:receiveCreditDecision>
    </ListOfcred:receiveCreditDecision>
  </receiveCreditDecision:parameters>
</PropertySet>

I need to get to the attributes of the decision tag

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-20
@Tomio

Try converting XML to PHP array. For example, with this library - https://packagist.org/packages/mtownsend/xml-to-array
Well, then it will be easier to get to the desired element)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question