Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Convert CSV to XML

by Corion (Pope)
on May 20, 2016 at 07:04 UTC ( #1163589=note: print w/replies, xml ) Need Help??

in reply to Convert CSV to XML

If you have the XSD of the taget XML, I recommend XML::Writer XML::Compile. You have to mush your input data into the data structure corresponding to the output XML data, but that's all you have to do. XML::Writer will then create the appropriate XML from the XSD and your data structure.

I've also had good experience in creating a template using HTML::Template(::Compiled) and filling in the data from a flat datastructure, but that really depends on the output XML format.

Replies are listed 'Best First'.
Re^2: Convert CSV to XML
by andreas1234567 (Vicar) on May 20, 2016 at 08:51 UTC
    Dear Corion,

    Thanks for your helpful reply. However, I cannot find any reference to XSD's in the documentation to XML::Writer. Do you have any pointers? Or did you perhaps mean XML::Compile as described in this blog post? Thanks again.

    Best regards
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1163589]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2021-03-08 00:10 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (123 votes). Check out past polls.