XML INVOICE CONVERT TO EXCEL
Blog entry: Submitted by 1202hakan on Fri, 2017-12-22 13:18. Last updated on Fri, 2017-12-22 13:18.
Hello! I work in a big company and we take a lot of E-Invoices from other companies. End of the every month E-Invoıces (more than 1000) are controlled manually from xml files. It tooks more than 3 days.
I need to convert XML files to EXCEL. Is there any way for that?
XSLT is your friend
Your post doesn't mention UBL specifically, but the answer is the same regardless.
I suggest you use XSLT to read your XML and then you write out an Excel file. XSLT is the best tool to transform XML into a result.
For your need, the easiest way is to write out a comma-separted values (CSV) file and then open that with Excel. The more difficult way is to learn the XML vocabulary of Excel and write out that kind of file.
Which you choose depends on how "smart" you want your Excel file to be. A CSV file will only place values into your Excel, whereas an Excel XML file can have formulae.
I hope this helps. A better place to ask such questions is UBL-Dev. Please see the instructions at the top of http://ubl.xml.org/forum
. . . . . Ken
Generic XSLT example
+1 to Ken's suggestion. There's a simple XML to CSV transformation stylesheet here:
https://www.javacodegeeks.com/2014/07/converting-xml-to-csv-using-xslt-1...
It's very generic and the resulting CSV/Excel is probably too messy for your need, but it demonstrates the principle. You can do the transformation from command line:
# xsltproc yourXSLT.xsl yourUBL.xml > your.csv
Happy Holidays!
Kenneth