Brinkbeibia
New Member
I have this type of XML fileExample of file part:\[code\]<!-- language: lang-xml --><ponudba podjetje="SO d.o.o." velja_od="23.09.2012 @ 12:30:48"> <artikel koda="LS593EAR" naziv="HP ENVY 17-2199e" kategorija="Prenosniki" podkategorija="Hewlett Packard (HP)" v_akciji="ne" kosovnost="ve?"> <opis> HP ENVY 17-2199el, Intel Core i7-2630QM (2.0 GHz), 17.3'' FHD AG LED 3D, 8 GB DDR3 (2x 4 GB), 1 TB, BluRay, ATI Radeon HD6850 1024 MB, WiFi, Bluetooth, Webcam, 3D glasses, Microsoft Windows 7 Home Premium (64 bit) </opis> <opis_detail> HP ENVY 17-2199el, Intel Core i7-2630QM (2.0 GHz), 17.3'' FHD AG LED 3D, 8 GB DDR3 (2x 4 GB), 1 TB, BluRay, ATI Radeon HD6850 1024 MB, WiFi, Bluetooth, Webcam, 3D glasses, Microsoft Windows 7 Home Premium (64 bit)<br/><table> <col width="25%" /> <col /> <tbody> <tr> <th>Procesor</th> <td>Intel? Core? i7-2630QM / 2.00 GHz / Quad-Core</td> </tr> <tr> <th>Delovni pomnilnik</th> <td>8 GB DDR3</td> </tr> <tr> <th>Trdi disk</th> <td>1 TB (1000 GB) / 5400 / SATA</td> </tr> <tr> <th>LCD zaslon</th> <td>43,9 cm (17,3'') Full HD HP Ultra BrightView Infinity Display (1920x1080)</td> </tr> <tr> <th>Grafi?na kartica</th> <td>AMD Radeon? HD 6850 Graphics</td> </tr> <tr> <th>Opti?na enota</th> <td>SuperMulti DVD-RW Double Layer</td> </tr> <tr> <th>USB 2.0</th> <td>2x</td> </tr> <tr> <th>USB 3.0</th> <td>1x</td> </tr> <tr> <th>eSATA</th> <td>da</td> </tr> <tr> <th>HDMI</th> <td>da</td> </tr> <tr> <th>WiFi</th> <td>da</td> </tr> <tr> <th>Bluetooth</th> <td>da</td> </tr> <tr> <th>WWAN</th> <td>ne</td> </tr> <tr> <th>Spletna kamera</th> <td>da</td> </tr> <tr> <th>Card Reader</th> <td>da</td> </tr> <tr> <th>Express Card</th> <td>ne</td> </tr> <tr> <th>TV kartica</th> <td>ne</td> </tr> <tr> <th>Finger Print</th> <td>ne</td> </tr> <tr> <th>Vhodne naprave</th> <td>brez</td> </tr> <tr> <th>Operacijski sistem</th> <td>Microsoft Windows 7 Home Premium (64 bit)</td> </tr> <tr> <th>Dr?ava uvoza</th> <td>Italijanska tipkovnica (prilo?ene SLO nalepke)</td> </tr> <tr> <th>Stanje modela</th> <td>HP Renew</td> </tr> </tbody> </table> </opis_detail> <garancija_v_mesecih>12</garancija_v_mesecih> <cena_v_EUR>1.049,00</cena_v_EUR> <proizvajalec>HP</proizvajalec> <stanje>na zalogi</stanje> <url_foto_artikla> http://www.so-doo.si/media/catalog/product/cache/1/image/265x/9df78eab33525d08d6e5fb8d27136e95/c/0/c02034964.jpg.hri_4.jpg </url_foto_artikla> <vec_fotk_artikla> <slika href="http://www.so-doo.si/media/catalog/product/c/0/c02034982.jpg.hri_4.jpg"/> <slika href="http://www.so-doo.si/media/catalog/product/c/0/c02034991.jpg.hri_4.jpg"/> </vec_fotk_artikla> <teza_artikla_v_kg>2.9000</teza_artikla_v_kg> </artikel>\[/code\]Now I try to convert this XML file into CSV using this type of code: \[code\]<?php$filexml='so_feed.xml';if (file_exists($filexml)) { $xml = simplexml_load_file($filexml);$f = fopen('sofeed.csv', 'w');foreach ($xml->naziv as $naziv) { fputcsv($f, get_object_vars($naziv),',','"');}fclose($f);}?>`\[/code\]where so_feed.xml is input XML file and sofeed.csv is output CSV file, and field "naziv" is node for which I need data.But I get only empty csv file. Some help, pls? Also when I use "artikel" node, i dont get whole info, just a part