D93AInterchangeFactory factory = D93AInterchangeFactory.getInstance();
factory.toUNEdifact(edi, ediOutStream1);
FileWriter write = new FileWriter("outputfile");
InputStream resourceConfigStream = new FileInputStream("myconfig.xml"); factory.addConfigurations(resourceConfigStream);
factory.toUNEdifact(interchange, writer);
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.2.xsd">
<params>
<param name="stream.filter.type">SAX</param>
</params>
<edi:reader mappingModel="/org/milyn/edi/unedifact/d93a/ORDRSP/edimappingconfig.xml" validate="false" />
<jb:bean beanId="ORDRSP.Segment_Group_25.QTY.C186" class="org.milyn.edi.unedifact.d93a.common.field.C186QuantityDetails" createOnElement="ORDRSP/Segment_Group_25/QTY/C186">
<jb:value property="e6063QuantityQualifier" data="ORDRSP/Segment_Group_25/QTY/C186/e6063" decoder="String" default="null" />
<jb:value property="e6060Quantity" data="ORDRSP/Segment_Group_25/QTY/C186/e6060" decoder="DABigDecimal" default="null">
<jb:decodeParam name="format">#,###</jb:decodeParam>
</jb:value>
<jb:value property="e6411MeasureUnitQualifier" data="ORDRSP/Segment_Group_25/QTY/C186/e6411" decoder="String" default="null" />
</jb:bean>
</smooks-resource-list>
[Fatal Error] :13:177: The prefix "jb" for element "jb:bean" is not bound.
--
You received this message because you are subscribed to a topic in the Google Groups "Smooks Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/smooks-user/6nybwaNVgS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/c5fff270-9b40-4090-a5ef-34ab73c2b92an%40googlegroups.com.
<dependency> <groupId>org.milyn</groupId> <artifactId>milyn-smooks-javabean</artifactId> <version>1.7.1</version> </dependency> <dependency> <groupId>org.milyn.edi.unedifact</groupId> <artifactId>d93a-binding</artifactId> <version>1.7.1.0</version> </dependency> <dependency> <groupId>org.milyn.edi.unedifact</groupId> <artifactId>d93a-mapping</artifactId> <version>1.7.1.0</version> </dependency>
import java.io.File;import java.io.FileInputStream;import java.io.FileWriter;import java.io.InputStream;import java.math.BigDecimal;import java.util.ArrayList;import java.util.List;
import org.junit.Test;import org.milyn.edi.unedifact.d93a.D93AInterchangeFactory;import org.milyn.edi.unedifact.d93a.ORDRSP.Ordrsp;import org.milyn.edi.unedifact.d93a.common.QTYQuantity;import org.milyn.edi.unedifact.d93a.common.field.C186QuantityDetails;import org.milyn.smooks.edi.unedifact.model.r41.UNEdifactInterchange41;import org.milyn.smooks.edi.unedifact.model.r41.UNEdifactMessage41;
public class SimpleTest {
@Test public void test() throws Exception {
D93AInterchangeFactory factory = D93AInterchangeFactory.getInstance();
InputStream resourceConfigStream = new FileInputStream("myconfig.xml"); factory.addConfigurations(resourceConfigStream);
File outFile = new File("test.edi"); UNEdifactInterchange41 interchange = new UNEdifactInterchange41(); List<UNEdifactMessage41> messages = new ArrayList<UNEdifactMessage41>(); interchange.setMessages(messages); messages.add(new UNEdifactMessage41()); Ordrsp ordrsp = createOrdrspWithQuantity1(); messages.get(0).setMessage(ordrsp);
FileWriter fw = new FileWriter(outFile.getAbsolutePath()); factory.toUNEdifact(interchange, fw);
} private Ordrsp createOrdrspWithQuantity1() { Ordrsp ordrsp = new Ordrsp(); List<org.milyn.edi.unedifact.d93a.ORDRSP.SegmentGroup25> seg25List = new ArrayList<org.milyn.edi.unedifact.d93a.ORDRSP.SegmentGroup25>(); org.milyn.edi.unedifact.d93a.ORDRSP.SegmentGroup25 seg25 = new org.milyn.edi.unedifact.d93a.ORDRSP.SegmentGroup25(); seg25List.add(seg25); ordrsp.setSegmentGroup25(seg25List); List<QTYQuantity> quantities = new ArrayList<QTYQuantity>(); seg25.setQTYQuantity(quantities); QTYQuantity delivQuantity = new QTYQuantity(); C186QuantityDetails delivQuantityDet = new C186QuantityDetails(); delivQuantityDet.setE6060Quantity(new BigDecimal(1)); delivQuantityDet.setE6411MeasureUnitQualifier("PCE"); delivQuantity.setC186QuantityDetails(delivQuantityDet); quantities.add(delivQuantity); return ordrsp; }
<?xml version="1.0"?><smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.2.xsd">
<params> <param name="stream.filter.type">SAX</param> </params>
<edi:reader mappingModel="/org/milyn/edi/unedifact/d93a/ORDRSP/edimappingconfig.xml" validate="false" />
<jb:bean beanId="ORDRSP.Segment_Group_25.QTY.C186" class="org.milyn.edi.unedifact.d93a.common.field.C186QuantityDetails" createOnElement="ORDRSP/Segment_Group_25/QTY/C186">
<jb:value property="e6060Quantity" data="ORDRSP/Segment_Group_25/QTY/C186/e6060" decoder="Integer" default="null"/> </jb:bean>
</smooks-resource-list>
QTY+:1.0:PCE'
To unsubscribe from this group and all its topics, send an email to smooks-user+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to smooks-user...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to smooks-user+unsubscribe@googlegroups.com.
Thanks!
To unsubscribe from this group and all its topics, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/c5fff270-9b40-4090-a5ef-34ab73c2b92an%40googlegroups.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/6f78fe83-a261-4018-a0c3-6c7009c793cbo%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/CA%2BbPaoJu8W%3DLcZ6NgoFq84oZsSv_9kGkvvP%2B0PMceriNX%2BROtg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/CACQRmg8E6sdJK3FG4zOMy_YkhFGh6e-dG_i9C%3DVX%2BBhndcGZrQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/CADvAAuiVKYTkGE7jKs%3D-6sQ5ut8ofTEsnWq5fNs08qX4e4q5XQ%40mail.gmail.com.