How to convert xml to csv

Hi

  i want to read xml data as same structure using php

my xml data structure is

    <root>
         <modal>
            <childmodal>name</childmodal>
                <childmodal>name</childmodal>
          </modal>
         <modal>
            <childmodal>name</childmodal>
                    <modal>
                         <childmodal>name</childmodal>
                        <childmodal>name</childmodal>
                    </modal>
             <childmodal>name</childmodal>
         </modal>
      </root>

if i use getelement by tag name as modal , i can retreive all modal data ,but i want to write same order in csv file like modal under submodal data. so any one help me how to read this structure .

Hi,

You can just save as text file and open via excel . it will open in cell format. and then either you copy content and paste in new editor and save . or directly do save as csv. it would be converted.

But if it would be nested then I am not sure how it will work. try it…

hi elsner thank you for response. After converting the csv i will change some content then again i need the xml file. in backend there is some database process for this xml. so can you please tell how to parse

  1. download the xml from that url into a file
  2. load xml into openoffice or msoffice, both know how to load xml, i’m not sure but is possible to do same thing with google doc
  3. save the document as csv, using save as.

i need to do in php , can you tell how to parse

Helo,

with the help of Luxon Software You Can Convert xml file to cxv file …
and you can use anyother software to convert your file…