in reply to Convert CSV file to XML file using Perl?
Also, consider all of your possibilities ... including, “writing no(!) computer program at all.”
A CSV to XML Converter in XSLT 2.0.
It can go the other way, too: XML to CSV Using XSLT.
In both cases, as you can see, the transformation is being accomplished using a declarative feature of industry-standard XML libraries such as libxslt, which of course are fully supported by Perl libraries such as XML::LibXML, but also by command-line tools such as Saxon. You specify what transformations you want, using an XML-based format to do so. It is the responsibility of the XSLT processor (and there are several of these) to obey those instructions.
There are widespread applications for this idea. For example, many documentation files are written in XML-based “semantic markup” languages such as DocBook, and then translated ... using XSLT ... into several different output formats. (All of the O’Reilly books ... the ones with animals on the cover ... are done that way.) No custom programming is involved.
I’ll leave it to others ... and to you ... to decide what is the overall best way to accomplish this goal for your particular project. With Perl, you have many, many choices.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert CSV file to XML file using Perl?
by Anonymous Monk on Jul 04, 2015 at 19:21 UTC | |
by laknarc (Initiate) on Jul 05, 2015 at 00:55 UTC | |
by bitingduck (Deacon) on Jul 05, 2015 at 05:45 UTC |