EDIFACT to XML

140 views
Skip to first unread message

ketan upadhyay

unread,
Mar 5, 2024, 5:50:29 AMMar 5
to Smooks Users
Hi,

SMOOKS v2.0.0-RC3

I am trying smooks edifact-to-xml to parse my EDIFACT file to XML, I am able to convert to the xml, however the result is not as expected. 
Can you please advise, how can i make custom xsd schema for edifact to xml mapping. It would be great help.
One more question, Passing the schema in "schemaUri" would be enough for mapping custom schema?

Claude Mamo

unread,
Mar 5, 2024, 12:30:40 PMMar 5
to smook...@googlegroups.com
What do you mean when you say that the "result is not as expected"?

Can you please advise, how can i make custom xsd schema for edifact to xml mapping. It would be great help.

It depends on your definition of "custom":
Note that the schemas are authored in DFDL. A bit of reading into DFDL, before getting your feet wet with it, won't hurt. Here is some reading material:

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/2fcfb83c-827c-459f-805e-34484cb7e376n%40googlegroups.com.

ketan upadhyay

unread,
Mar 6, 2024, 10:06:04 AMMar 6
to Smooks Users
Hi Claude,

I have tried to parse INSDES message with the default schemas but the message went to <D03B:BadMessage>.(Still not working) (I have attached the INSDES file I have inputted some dummy data but the structure would be the same)

Thanks for the DFDL materials, It really helped.

I was looking for "/d03b/EDIFACT-Messages.dfdl.xsd" but could not find any (In edifact-cartridge found the zip files but after extracting could not find any dfdl schemas). I have picked the D03B schemas from your project https://github.com/claudemamo/smooks-examples/tree/edifact-schema-override/xml-to-edifact-override
and modify some things and tried the my "PRICAT" message and worked fine. Thank you.

INSDES.txt

ketan upadhyay

unread,
Mar 7, 2024, 3:42:55 AMMar 7
to Smooks Users
Hi Claude,

My INSDES Had an error in NAD seg., City Name was more then default, changed Max Length and worked. Thanks,

Claude Mamo

unread,
Mar 7, 2024, 5:08:19 AMMar 7
to smook...@googlegroups.com
Yeah, it seems like you are on a different flavour of EDIFACT than the one distributed from https://unece.org/trade/uncefact/unedifact/download . Are you by any chance using EACOM?

Claude

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.

ketan upadhyay

unread,
Mar 7, 2024, 5:56:12 AMMar 7
to Smooks Users
Hi Claude,

Correct we are using EANCOM Standards. 

Are there any available dfdl schemas for these standards? or Do I have to customize the schemas regards to the standards? 
The edifact Messages comes from the SAP, Is there a way to export the schemas from SAP? ( Just a thought )

Claude Mamo

unread,
Mar 8, 2024, 2:09:04 AMMar 8
to smook...@googlegroups.com
Are there any available dfdl schemas for these standards?

Not to my knowledge, at least not open-source. Try asking in the Apache Daffodil user forum if you'd like to get an authoritative answer though :)

Do I have to customize the schemas regards to the standards?

That would be the easiest way in my opinion. You could, however, generate DFDL schemas from the EANCOM implementation guidelines like we did for EDIFACT. Mind you, this wasn't easy for EDIFACT because the directories are described in free-form text. Maybe it's easier for EANCOM? Anyone knows?

The edifact Messages comes from the SAP, Is there a way to export the schemas from SAP? ( Just a thought )

Don't know if you can can export schemas from SAP or even whether they are in DFDL for that matter. But if you are able to obtain the schemas, it should be possible to convert them into DFDL. One could leverage XSLT for this task if the schemas from SAP are in XML.

 Claude

On Thu, Mar 7, 2024 at 11:56 AM ketan upadhyay <ketan22...@gmail.com> wrote:
Hi Claude,

Correct we are using EANCOM Standards. 

Are there any available dfdl schemas for these standards? or Do I have to customize the schemas regards to the standards? 
The edifact Messages comes from the SAP, Is there a way to export the schemas from SAP? ( Just a thought )

On Thursday, March 7, 2024 at 3:38:19 PM UTC+5:30 Claude wrote:
Yeah, it seems like you are on a different flavour of EDIFACT than the one distributed from https://unece.org/trade/uncefact/unedifact/download . Are you by any chance using EACOM?

Claude

On Thu, Mar 7, 2024 at 9:42 AM ketan upadhyay <ketan22...@gmail.com> wrote:
Hi Claude,

My INSDES Had an error in NAD seg., City Name was more then default, changed Max Length and worked. Thanks,

On Wednesday, March 6, 2024 at 8:36:04 PM UTC+5:30 ketan upadhyay wrote:
Hi Claude,

I have tried to parse INSDES message with the default schemas but the message went to <D03B:BadMessage>.(Still not working) (I have attached the INSDES file I have inputted some dummy data but the structure would be the same)

Thanks for the DFDL materials, It really helped.

I was looking for "/d03b/EDIFACT-Messages.dfdl.xsd" but could not find any (In edifact-cartridge found the zip files but after extracting could not find any dfdl schemas). I have picked the D03B schemas from your project https://github.com/claudemamo/smooks-examples/tree/edifact-schema-override/xml-to-edifact-override
and modify some things and tried the my "PRICAT" message and worked fine. Thank you.

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.

ketan upadhyay

unread,
Mar 8, 2024, 6:03:51 AMMar 8
to Smooks Users
Hi Claude,

GS1 org have provided the standards for EANCOM https://www.gs1.org/standards/edi/eancom/syntax-4, With help of this i might be able to create custom schema but It would be bit of work.
I have found the xml schemas for EANCOM from gs1 org, https://www.gs1.org/docs/EDI/xml/3.6/GS1_XML_3-6_Publication.zip. I tried to convert to dfdl from an IBM toolkit but failed.
Can you provide me a source where I could convert the xml schemas to dfdl schema and use that in smooks? (Would that work?)

If you know about any Apache Daffodil user forum, can you mention it please?. That would be great help. Thanks.

Claude Mamo

unread,
Mar 11, 2024, 3:23:09 AMMar 11
to smook...@googlegroups.com
Can you provide me a source where I could convert the xml schemas to dfdl schema and use that in smooks? (Would that work?)

I would use XSLT to transform the EANCOM XSDs to DFDL schemas. I did a quick search on GitHub and the closest thing I could find is https://github.com/mescedia/mescedia-core/blob/9a7f1ded3bda83c6e77d3fb905f12707fca221cf/data/mappings/szenario/10000/DESADV.xml_dfdlxml-D01B.xslt. However, I don't know if the source is EANCOM. Perhaps the folks at Mescedia can help out? I know for sure that some of their engineers are subscribed to this forum.

If you know about any Apache Daffodil user forum, can you mention it please?. That would be great help. Thanks.

Yeah there's the official one and the maintainers are very responsive. You need to subscribe to the mailing list to be able to post their: https://daffodil.apache.org/community/

Claude

ketan upadhyay

unread,
Mar 13, 2024, 10:29:59 AMMar 13
to Smooks Users
Hi Claude,

I have used my custom XSLT (to get XML which i want) to transform an XML output got from smooks, It worked.
Thank you.

Reply all
Reply to author
Forward
0 new messages