XML to CSV??! anyone know how

I have a bunch of XML docs i need to convert to a CSV. I am no programmer. I search the google machine and i downloaded some freeware…. but it didnt exactly let me map anything and convert it.

ANyone know how to do this fairly simple, maybe even a script or something i could run on it? anything?

Unless the XML is flat (which would somewhat defeat the purpose of xml) then you can’t really create a "spreadsheet" out of the data

It is sort of flat. the data is all lined up that i need. Its only provided in XML though. Imagine if Amazon gave you a xml dump of a brands products they sell. it would have sku, price, color etc. thats what this looks like. So it could technically be organized into a spreadsheet. i just have no idea how to do that.

Load up an XML parser with your language of choice, loop through the nodes that you need, append to a file with commas

No thats what i mean i am no programmer. Im sure it can be done in PHP, i just dont know how to write it. So i am looking for a work around for now to get these all into a CSV, or even a database that i could export a CSV from.

I’m not sure if there is a "tool" that will take any xml document and output it to csv. You’re probably better off just hiring some code monkey to do it for 1-2hrs of work

I imagine that would be really simple in PHP. if it’s not sensitive data, just post it and someone might be bored enough to knock it out

newer versions of excel can import XML. and then just export to CSV

this

This new feature lets you get information from filetypes such as xml, html, csv, tsv, as well as RSS and Atom feeds…

Functions:

=importXML("URL","query")

  • URL – the URL of the XML or HTML file
  • query – the XPath query to run on the data given at the URL. For example, "//a/@href" returns a list of the href attributes of all <a> tags in the document (i.e. all of the URLs the document links to). For more information about XPath, please visit
  • Example: =importXml("www.google.com", "//a/@href"). This returns all of the href attributes (the link URLs) in all the <a> tags on home page

Theoretically that should work..
then you can rearrange it in the spreadsheet and download a CSV file

Unfortunatley for me it is sensitive data that i can’t post otherwise that would make it easy for me to explain. I tried importing it in excel and it seems like it split it up correct, im going to try a few other of the xml files. i just think this one has a bunch of blank attributes which is why its scattered.

All the XML programs are just confusing thus far. I will report back when i try a few other files in excel. ovbiousl php would be easy to use to open all of these and change em over so i might have to hire a code money to do it if this doesnt work.

This is your answer.
I would recommend dropping by w3schools.com and reading these
XML tutorial:
XPath tutorial:
XSLT tutorial:
In that order.

Take your time to understand it and doing the transformation will be a cinch.

This is your answer.
I would recommend dropping by w3schools.com and reading these
XML tutorial:
XPath tutorial:
XSLT tutorial:
In that order.

Take your time to understand it and doing the transformation will be a cinch.

reading them now. opening in excel seemed to work but the data is split up really weird. thanks for the links.