XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Bruce CantorSubject: Problem with UNB
Author: Bruce Cantor
Date: 26 May 2021 10:40 AM
Hi Forum

I am experiencing a problem with a XML > EDIFACT conversion.
I have done a number of these conversions without seeing this before, but this particular conversion is creating output where the UNB has a whitespace in the line, just before the timestamp:

UNB+UNOC:3+4335347139011:14+8719333008318:14+ 210526:1228+21052612281158++DESADV++++1'

I have created a simple scenario in order to test and found that this happens even if I do nothing more than convert the edifact file to xml and then convert it back to edifact.

Can anybody tell me how to fix this problem?
Thank you for any help.


UnknownUNB_problem.zip
zip file with pipeline and testdata

Postnext
Ivan PedruzziSubject: Problem with UNB
Author: Ivan Pedruzzi
Date: 27 May 2021 01:09 AM
Bruce the problem is the syntax version which is 3.

UNB+UNOC:3

In version 3 the date field UNB0401 (S004->0017) is a 6 digits number.

Our converter uses the date field definition from syntax version 4 which is 8 digits number.

When converting from XML to EDI the engine prepares an 8 digits space and fills with 6 digits value, so you experience the two spaces before the value.

one possible workaround is to override the date field minimum length creating a SEF file using Stylus Studio EDI to XML Conversion.

Once you have the SEF you can reference it from the converter URL like in the following example

converter:EDI:decimal=.:encoding=ISO-8859-1:user=file:///g:/myfolder/6_DIGITS_UNB0401.sef

I attached some screenshots and I altered your example to show how it works.

Ivan Pedruzzi
Stylus Studio Team


Document6_DIGITS_UNB0401.zip


Unknownxml-converter-architecture_2.png

Postnext
Bruce CantorSubject: Problem with UNB
Author: Bruce Cantor
Date: 31 May 2021 08:22 AM
Thanks, works fine.

Postnext
Ivan PedruzziSubject: Problem with UNB
Author: Ivan Pedruzzi
Date: 08 Jun 2021 06:56 PM
Bruce,

our EDI experts provided additional insights

This transaction is not EDIFACT but rather EANCOM, specified by field UN = EAN007

DESADV:D;01B:UN:EAN007

Our EDI converter engine uses the EANCOM 2002 "01B" definition of the UN* segments, which map UNB0401 to 8 digits, even though it's syntax 3.
EANCOM 2002 has its own definition of the UN* segments, instead of leaving it EDIFACT.

You can force to interpret the transaction as EDIFACT using the following URL, the syntax will be correctly interpreted as 3 and the the date field will be sized properly

converter:EDI:dialect=EDIFACT


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
Bruce CantorSubject: Problem with UNB
Author: Bruce Cantor
Date: 11 Jun 2021 10:46 AM
This is a better solution.

When you specify the user file option the URL is not relative and deployment needs manual editing in pipeline file in order to work
Also saves a lot of work since sef file definition is not needed.

/ Bruce

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.