vendredi 11 novembre 2016

Parsing XML in laravel

i have a XML file with account information i need to be loaded in my users table in my database.

i found this package for laravel for xml parsing, i came thus far that i can load my XML but now i am stuck...

http://ift.tt/1KBdWon

the code

$xml = XmlParser::load(url('/xml/DEBTORS.xml'));
    dd($xml);
    $user = $xml->parse([
       'Name' => ['uses','Accounts.Account.Name'],
    ]);

$user Name returns NULL

enter image description here

Part of the xml for example

<Account code="1004" status="A" type="C">

 <Name>example name here</Name>

 <Phone>emaple phone here</Phone>

for example i want to reach Account Code in @attributes and assign that to ID

Any help is appreciated



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire