Edit XML with php script

Đã hoàn thành Đã đăng vào Feb 6, 2016 Thanh toán khi bàn giao
Đã hoàn thành Thanh toán khi bàn giao

In an xml file I have this structure (with <post>repeating) :

<data>

<post>

<deal_id>479</deal_id>

<deal_title><![CDATA[Δίπλωμα Μηχανής, στη Σχολή Οδηγών Παραστατίδης στον Εύοσμο, μόνο με 49€]]></deal_title>

<deal_url>[login to view URL]</deal_url>

<deal_city><![CDATA[Θεσσαλονίκη]]></deal_city>

<deal_price><![CDATA[49]]></deal_price>

<deal_previous_price><![CDATA[125]]></deal_previous_price>

<deal_discount><![CDATA[60.8]]></deal_discount>

<deal_start><![CDATA[2016-01-10 00:00:00]]></deal_start>

<deal_end><![CDATA[2016-04-01 00:00:00]]></deal_end>

<deal_image>

<image>

<file>[login to view URL]</file>

<title>c700x420</title>

<caption></caption>

<description></description>

<alt></alt>

</image>

<image>

<file>[login to view URL]</file>

<title>diploma1</title>

<caption></caption>

<description></description>

<alt></alt>

</image>

</deal_image>

<deal_sales><![CDATA[0]]></deal_sales>

<deal_active><![CDATA[true]]></deal_active></post></data>

and I would like to transform the <deal_image> to

<deal_image>[login to view URL]</deal_image>

which means keep only the first appearing jpg and discard the rest..and do that for all <post>

Can you do that with php?

So the desired output would be something like this:

<data>

<post>

<deal_id>479</deal_id>

<deal_title><![CDATA[Δίπλωμα Μηχανής, στη Σχολή Οδηγών Παραστατίδης στον Εύοσμο, μόνο με 49€]]></deal_title>

<deal_url>[login to view URL]</deal_url>

<deal_city><![CDATA[Θεσσαλονίκη]]></deal_city>

<deal_price><![CDATA[49]]></deal_price>

<deal_previous_price><![CDATA[125]]></deal_previous_price>

<deal_discount><![CDATA[60.8]]></deal_discount>

<deal_start><![CDATA[2016-01-10 00:00:00]]></deal_start>

<deal_end><![CDATA[2016-04-01 00:00:00]]></deal_end>

<deal_image>[login to view URL]</deal_image>

<deal_sales><![CDATA[0]]></deal_sales>

<deal_active><![CDATA[true]]></deal_active></post></data>

Note that the deal_image tag kept only the url of the first image and ignored the rest. In my xml file there are lots of <post></post> sections, which should also be processed in an iteration.

PHP Kiến trúc phần mềm

ID dự án: #9580381

Về dự án

9 đề xuất Dự án từ xa Feb 7, 2016 đang mở

Được trao cho:

jdkamlesh

Hello, Happy to have your attention and thanks for this wonderful opportunity. I am very good in ajax,css,jquery,php. please see me here too : [login to view URL]~01b68317aea2fe8570/ I'm Thêm

€23 EUR trong 1 ngày
(17 Đánh Giá)
4.4

9 freelancer chào giá trung bình€28 cho công việc này

mderevyanchuk

Hi! I can do xml trnasformation in php! Feel free to contact me. We can finish your project quickly.

€19 EUR trong 0 ngày
(35 Nhận xét)
5.6
cracken

Hi, I, based on my 5 years of experience as a software engineer knowledgeable with tools automation, can handle this task pretty well. Let me know the best of your time so we can discuss further based on your requirem Thêm

€29 EUR trong 0 ngày
(17 Nhận xét)
5.0
deliveryweb

I can show the complex xml generation that I did for Google KML files. if you award the project quickly you can get it all sorted within few hours. i will give you php script that makes the conversion.

€29 EUR trong 1 ngày
(10 Nhận xét)
4.6
NumanArif

hi there i can make this project as required.............................................................................................................................................................................. Thêm

€29 EUR trong 1 ngày
(9 Nhận xét)
4.0
motazahmed

i am a professional Web Developer, html5 , php5, JavaScript , jquery , jquery mobile, Wordpress, android developer ,bootstrap3 , PhotoShop , CodeIgniter . i am doing PHP and MySQL from 2006 till now , i almost 10 year Thêm

€28 EUR trong 1 ngày
(2 Nhận xét)
1.9
zedarsl

Ελληνας προγραμματιστης

€34 EUR trong 2 ngày
(0 Nhận xét)
0.0