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
Stanislav SabolSubject: EDI/XML question
Author: Stanislav Sabol
Date: 06 Sep 2006 04:50 AM
Hi,
I am trying to find java API for converting EDI to XML and XML to EDI. I found something like this on your webpage : "The Stylus Studio XML Deployment Components consist of the same Java library as the Stylus Studio Java API, but it can be intstalled separately and is governed by a separate license. You can use this API completely independently of Stylus Studio 2006 XML Enterprise Edition". So i want to be sure if it is possible to write Java application using only Stylus Studio XML Deployment Adapters that can convert EDi to XML and XML to EDI? And if there is some Java documentation for Deployment Adapters.

thank you

Postnext
Tony LavinioSubject: EDI/XML question
Author: Tony Lavinio
Date: 06 Sep 2006 04:42 PM
You can create a Converter object and write XML through it
to have it render as EDI, or read EDI through it to have it
return XML.

See http://www.stylusstudio.com/docs/v2006R3/d_deploy_comps9.html
for an example of using the Java Converter object. EDI would
work the same except the URI scheme would be "adapter:EDI" instead
of "adapter:CSV".

Postnext
Stanislav SabolSubject: EDI/XML question
Author: Stanislav Sabol
Date: 07 Sep 2006 05:10 AM
Originally Posted: 07 Sep 2006 05:08 AM
thank you,
i successfully converted from EDI to XML and than back but i have one question. My edi file looks like this:
ISA:00: :00: :01:1515151515 :01:5151515151 :041201:1217:U:00403:000032123:0:P:*~GS:CT:9988776655:1122334455:20041201:1217:128:X:004030~ST:831:00128001~BGN:00:88200001:20041201~N9:BT:88200001~TRN:1:88200001~AMT:2:100000.00~QTY:46:1~SE:7:00128001~GE:1:128~IEA:1:000032123~

i convert it to XML and everything is fine ... than i convert this XML file back to EDI and file looks like this:
ISA+00+ +00+ +01+1515151515 +01+5151515151 +041201+1217+U+00403+000032123+0+P+*'GS+CT+9988776655+1122334455+20041201+1217+128+X+004030'ST+831+00128001'BGN+00+88200001+20041201'N9+BT+88200001'TRN+1+88200001'AMT+2+100000.00'QTY+46+1'SE+7+00128001'GE+1+128'IEA+1+000032123'

and the question ... Is there any way hot to get identical file after conversion? ... how to change segment terminator(' to ~) and data element separator (+ to :) in my case...
thanks

my code :

try {
StylusFile in_1 = sff.createStylusFile("adapter:///EDI:decode=no,:field=no?file:C:/Program Files/Stylus Studio 6 XML Enterprise Edition/examples/Adapters/test/831.edi");
File out_1 = new File(path+"test\\output.xml");
InputStream is = in_1.getInputStream();
OutputStream os = new FileOutputStream(out_1);
copy(is, os);
in_1.close();
System.out.println("test 1 succeeded: 831.edi -> output.xml");
} catch (IOException ioe) {
ioe.printStackTrace();
}

try {
File in_2 = new File(path+"/test/output.xml");
StylusFile out_2 = sff.createStylusFile("adapter:///EDI:eol=no?file:C:/Program Files/Stylus Studio 6 XML Enterprise Edition/examples/Adapters/test/xml2Edi831.edi");
InputStream is = new FileInputStream(in_2);
OutputStream os = out_2.getOutputStream();
copy(is, os);
out_2.close();
System.out.println("test 2 succeeded: output.xml -> xml2Edi831.edi");
} catch (IOException ioe) {
ioe.printStackTrace();
}

Posttop
Tony LavinioSubject: EDI/XML question
Author: Tony Lavinio
Date: 07 Sep 2006 10:09 AM
See http://www.stylusstudio.com/docs/v2006R3/d_flatfileconversion39.html

 
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.