EDI 2 XML conversion

K

karenmiddleol

I want to convert EDI Purchase Order document to XML or to a CSV
output. Can the XML parse a EDI document and emit a XML or CSV output

Please kindly advice how best it can be done.

Thanks
Karen
 
S

Samwyse

I want to convert EDI Purchase Order document to XML or to a CSV
output. Can the XML parse a EDI document and emit a XML or CSV output

Please kindly advice how best it can be done.

I don't know EDI, but I recall that it predates XML; therefore I
strongly suspect that an XML parser won't like it. You need an EDI
parser (don't ask me where to find one) that creates a Perl structure,
then you can use XML::Simple (or something similar) to output that
structure as an XML document. This does not mean that the node names or
structure will be meaningful to another application, just that the
document will contain valid XML constructs.

I seriously doubt that CSV output will be useful, unless you just want
the actual items. I suspect that the EDI document will contain a great
deal of "wrapper" information, such as PO numbers, Ship-To and Bill-To
information, etc, that at best would require awkward formatting in a CSV
file.

My advice is to beg, borrow or steal an EDI module, unless you know
enough to write your own. Then you can try something like this:

use My::EDI::parser;
use XML::Simple;
foreach (@ARGV) {
my $document = EDI_File_In($_);
print XML_Out($document);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top