Hi, I'm parsing EDIFACT files for quite some years now, not yet in Windev, but still in BASIC. The basic advice, however, remains to be the same.
0 - Do you know the basics? EDIFACT is standardized by the United Nations and therefore you'll find the specs here: [
www.unece.org]
EDIFACT files can be represented either in a plain string or in XML-file, mostly sent / received by a web service. Neither of the two representations is easy to read. Ok, what's easy in our profession ..
1 - If the EDIFACT messages you expect seem too complicated then why not use one of the prefabricated EDIFACT-converters? They do not come cheap but its much faster to get something working. Integration of EDIFACT into an existing software application is still not easy and will take a lot of your time. See: [
www.edifactory.de] (You can find a syntax checker there, just in case you're building EDIFACT strings and want to test for compliance)
2 - Most EDIFACT files of string-type should be short enough to be loaded into a string. From there, the parsing will take place.
3 - Converting EDIFACT strings into an XML-file should be possible, I do not see much benefit in it. There'd be two sources of errors, one in the conversion business and another in parsing / traversing the XML-file. Be warned, some identifiers look quite the same but are different in their meaning and their specifiers. Depending on the version of EDIFACT. Quite a number of versions is used in parallel, so, take care of the specific version!
4 - Parsing is relatively easy, you cut the string into pieces, called 'segments' using the information from the UNA-segment. WinDev has the great command ExtractString(..) for that. After getting the information of each main-segment and its specifiers you come back to this point, for multiple sub-segments (specifiers) of a single segment you have to have a point of return in each main segment code. In fact, you have to know what to expect. Its a lot of help, if the (future) sender of EDIFACT-files sends you an example file which contains all possible segments. Most companies in the retail business have sample files and specifications so that you know what to expect and what not.
This was was the starting point, feel free to ask further questions ..
Regards, Guenter