edi to xml mapping unexpected tags

21 views
Skip to first unread message

Carlos Rodolfo Schrader Garcia Escobar

unread,
May 14, 2021, 2:57:28 PMMay 14
to Smooks Users

Hi guys hope you are doing great !

im doing a conversion from X12 to Xml using smooks V2,  my input data is this

ISA*00* *00* *ZZ*CVS *01*Supplier ID *130212*1608*U*00401*000010952*0*P*^~GS*PO*CVS*Supplier ID *20130212*1608*5850*X*004010~ST*850*179960~BEG*00*NE*9999999**20130212~FOB*PP*US*free from text Desctiption*QualifierCode*TradeTerms~DTM*002*20210605~DTM*010*20210528~DTM*177*20130606~N9*L1*PO COMMENTS*Free form description~MSG*THIS PO SUBJECT TO THE TERMS AND CONDITIONS FOUND ON CVS SUPPLIERS WEBSITE~N1*ST*someone*54*Y101~N2*free from name ~N4*WAVERLY****NY*14892~TD5****H*~N1*bt*billName*54*Y101~N2*free from name ~N4*WAVERLY****NY*14892~TD5****H*~PO1**1*CA*57.6*CP*UA*999999*IN*099999999999*VN*099999999991*************UK*125438245689784~PID*F****FreeTextDescription~SAC*A*C1310******0****~SAC*C*C1310******0****~CTT*1**75.0*UN*222*CF~AMT*TT*4320~SE*20*179960~GE*38*5850~IEA*1*000010952~

 my mapping schema is this

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ibmEdiFmt="http://www.ibm.com/dfdl/EDI/Format">

<xsd:import namespace="http://www.ibm.com/dfdl/EDI/Format"
schemaLocation="/EDIFACT-Common/IBM_EDI_Format.dfdl.xsd"/>

<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format ref="ibmEdiFmt:EDIFormat"/>
</xsd:appinfo>
</xsd:annotation>

<xsd:element name="PO">
<xsd:complexType>
<xsd:sequence>
<xsd:sequence dfdl:initiatedContent="yes">

<xsd:element dfdl:initiator="ISA" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="interchange-Control-Header" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Authorization-Information-Qualifier" type="xsd:string"/>
<xsd:element name="Authorization-Information" type="xsd:string"/>
<xsd:element name="Security-Information-Qualifier" type="xsd:string"/>
<xsd:element name="Security-Information" type="xsd:string"/>
<xsd:element name="Interchange-ID-Qualifier-code" type="xsd:string"/>
<xsd:element name="Interchange-Sender-ID" type="xsd:string"/>
<xsd:element name="Interchange-ID-Qualifier" type="xsd:string"/>
<xsd:element name="Interchange-Receiver-ID" type="xsd:string"/>
<xsd:element name="Interchange-Date" type="xsd:string"/>
<xsd:element name="Interchange-Time" type="xsd:string"/>
<xsd:element name="Interchange-Control-Standards-Identifier" type="xsd:string"/>
<xsd:element name="Interchange-Control-Version-Number" type="xsd:string"/>
<xsd:element name="Interchange-Control-Number" type="xsd:string"/>
<xsd:element name="Acknowledgement-Requested" type="xsd:string"/>
<xsd:element name="Usage-Indicator" type="xsd:string"/>
<xsd:element name="Component-Element-Separator" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="GS" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Group-Header" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Functional-Code-Identifier" type="xsd:string"/>
<xsd:element name="Application-Senders-Code" type="xsd:string"/>
<xsd:element name="Application-Receivers-Code" type="xsd:string"/>
<xsd:element name="Date" type="xsd:string"/>
<xsd:element name="Time" type="xsd:string"/>
<xsd:element name="Group-Control-Number" type="xsd:string"/>
<xsd:element name="Responsible-Agency-Code" type="xsd:string"/>
<xsd:element name="Version-Release-Industry-Identifier-Code" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>


<xsd:element dfdl:initiator="ST" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="transaction-Set" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="transaction-code" type="xsd:string"/>
<xsd:element name="transaction-set-control-number" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="BEG" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="beginning-segment" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="purpose-code" type="xsd:string"/>
<xsd:element name="Po-type" type="xsd:string"/>
<xsd:element name="Po-Number" type="xsd:string"/>
<xsd:element name="empty" type="xsd:string"/>
<xsd:element name="Date" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="FOB" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Fob-Instructions" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="shipment-Method-Payment" type="xsd:string"/>
<xsd:element name="Location-Qualifier" type="xsd:string"/>
<xsd:element name="Description" type="xsd:string"/>
<xsd:element name="Transportation-Terms-Qualifier-Code" type="xsd:string"/>
<xsd:element name="Transportation-Terms-Code" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="DTM" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Date-Time-Reference" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="date-Time-qualifier" type="xsd:string" />
<xsd:element name="date" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="N9" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Reference-Identification" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Reference-Identification-Qualifier" type="xsd:string" />
<xsd:element name="Reference-Identification" type="xsd:string"/>
<xsd:element name="Free-form-Description" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="MSG" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Message-Text" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Free-Form-Message-Text" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="N1" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Name" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Entity-Identifier-Code" type="xsd:string" />
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Identification-Code-Qualifier" type="xsd:string" />
<xsd:element name="Identification-Code" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="N2" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Additional-Name-Information" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="N4" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Geographic-Location" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="City-Name" type="xsd:string" />
<xsd:element name="n402" type="xsd:string" />
<xsd:element name="n403" type="xsd:string" />
<xsd:element name="n404" type="xsd:string" />
<xsd:element name="location-qualifier" type="xsd:string" />
<xsd:element name="Location-Identifier" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="TD5" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Carrier-Details" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="TD01" type="xsd:string" />
<xsd:element name="TD02" type="xsd:string" />
<xsd:element name="TD03" type="xsd:string" />
<xsd:element name="Transportation-Method" type="xsd:string" />
<xsd:element name="TD05" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="PO1" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Baseline-Item-Data" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="PO101 " type="xsd:string" />
<xsd:element name="Quantity-Ordered " type="xsd:string" />
<xsd:element name="Unit-Measurement " type="xsd:string" />
<xsd:element name="Unit-Price " type="xsd:string" />
<xsd:element name="Basis-of-Unit-Price-Code " type="xsd:string" />
<xsd:element name="Product-Service-ID-Qualifier-one" type="xsd:string" />
<xsd:element name="Product-Service-ID " type="xsd:string" />
<xsd:element name="Product-Service-ID-Qualifier-Code " type="xsd:string" />
<xsd:element name="Product-Service-ID-code " type="xsd:string" />
<xsd:element name="PO110 " type="xsd:string" />
<xsd:element name="PO111 " type="xsd:string" />
<xsd:element name="PO112 " type="xsd:string" />
<xsd:element name="PO113 " type="xsd:string" />
<xsd:element name="PO114 " type="xsd:string" />
<xsd:element name="PO115 " type="xsd:string" />
<xsd:element name="PO116 " type="xsd:string" />
<xsd:element name="PO117 " type="xsd:string" />
<xsd:element name="PO118 " type="xsd:string" />
<xsd:element name="PO119 " type="xsd:string" />
<xsd:element name="PO120 " type="xsd:string" />
<xsd:element name="PO121 " type="xsd:string" />
<xsd:element name="PO122 " type="xsd:string" />
<xsd:element name="PO123 " type="xsd:string" />
<xsd:element name="Product-Service-ID-Qualifier " type="xsd:string" />
<xsd:element name="Product-Service-D " type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="PID" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Product-Item-Description" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Item-Description-Type" type="xsd:string" />
<xsd:element name="PID02" type="xsd:string" />
<xsd:element name="PID03" type="xsd:string" />
<xsd:element name="PID04" type="xsd:string" />
<xsd:element name="Description" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>


<xsd:element dfdl:initiator="SAC" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Allowance-or-Charge-Information" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Allowance-or-Charge-Indicator" type="xsd:string" />
<xsd:element name="Service-Promotion-Allowance-or-Charge-Code" type="xsd:string" />
<xsd:element name="SAC03" type="xsd:string" />
<xsd:element name="SAC04" type="xsd:string" />
<xsd:element name="SAC05" type="xsd:string" />
<xsd:element name="SAC06" type="xsd:string" />
<xsd:element name="SAC07" type="xsd:string" />
<xsd:element name="Rate" type="xsd:string" />
<xsd:element name="SAC9" type="xsd:string" />
<xsd:element name="SAC10" type="xsd:string" />
<xsd:element name="SAC11" type="xsd:string" />
<xsd:element name="Allowance-Charge-Method-f-Handling-Code" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>



<xsd:element dfdl:initiator="CTT" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Transaction-Totals" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Number-of-Line-Items" type="xsd:string" />
<xsd:element name="CTT02" type="xsd:string" />
<xsd:element name="Weight" type="xsd:string" />
<xsd:element name="Unit-or-Basis-for-Measurement-Code" type="xsd:string" />
<xsd:element name="Volume" type="xsd:string" />
<xsd:element name="Unit-or-Basis-for-Measurement-Cod" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>


<xsd:element dfdl:initiator="AMT" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Monetary-Amount" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Amount-Qualifier-ode" type="xsd:string" />
<xsd:element name="Monetary-Amount" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="SE" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="Transaction-Set-Trailer" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="Number-of-Included-Segments" type="xsd:string" />
<xsd:element name="Transaction-Set-Control-Number" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="GE" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="functional-group-end" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="GE01" type="xsd:string" />
<xsd:element name="GE2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element dfdl:initiator="IEA" dfdl:ref="ibmEdiFmt:EDISegmentFormat" name="interchange-control-trailer" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
<xsd:element name="functional-groups-involved" type="xsd:string" />
<xsd:element name="control-numbers" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

 and my configuration for smooks is this

<?xml version="1.0"?>

<smooks-resource-list
xmlns="https://www.smooks.org/xsd/smooks-2.0.xsd"
xmlns:edi="https://www.smooks.org/xsd/smooks/edi-2.0.xsd">

<edi:parser schemaURI="/ediToXml/po/edi-to-xml-order-mapping.dfdl.xsd" segmentTerminator="~" dataElementSeparator="*"
compositeDataElementSeparator="^"/>
</smooks-resource-list>

im getting this response

<PO>
<interchange-Control-Header>
<Authorization-Information-Qualifier>00</Authorization-Information-Qualifier>
<Authorization-Information></Authorization-Information>
<Security-Information-Qualifier>00</Security-Information-Qualifier>
<Security-Information></Security-Information>
<Interchange-ID-Qualifier-code>ZZ</Interchange-ID-Qualifier-code>
<Interchange-Sender-ID>CVS</Interchange-Sender-ID>
<Interchange-ID-Qualifier>01</Interchange-ID-Qualifier>
<Interchange-Receiver-ID>Supplier ID</Interchange-Receiver-ID>
<Interchange-Date>130212</Interchange-Date>
<Interchange-Time>1608</Interchange-Time>
<Interchange-Control-Standards-Identifier>U</Interchange-Control-Standards-Identifier>
<Interchange-Control-Version-Number>00401</Interchange-Control-Version-Number>
<Interchange-Control-Number>000010952</Interchange-Control-Number>
<Acknowledgement-Requested>0</Acknowledgement-Requested>
<Usage-Indicator>P</Usage-Indicator>
<Component-Element-Separator>^</Component-Element-Separator>
</interchange-Control-Header>
<Group-Header>
<Functional-Code-Identifier>PO</Functional-Code-Identifier>
<Application-Senders-Code>CVS</Application-Senders-Code>
<Application-Receivers-Code>Supplier ID</Application-Receivers-Code>
<Date>20130212</Date>
<Time>1608</Time>
<Group-Control-Number>5850</Group-Control-Number>
<Responsible-Agency-Code>X</Responsible-Agency-Code>
<Version-Release-Industry-Identifier-Code>004010</Version-Release-Industry-Identifier-Code>
</Group-Header>
<transaction-Set>
<transaction-code>850</transaction-code>
<transaction-set-control-number>179960</transaction-set-control-number>
</transaction-Set>
<beginning-segment>
<purpose-code>00</purpose-code>
<Po-type>NE</Po-type>
<Po-Number>9999999</Po-Number>
<empty></empty>
<Date>20130212</Date>
</beginning-segment>
<Fob-Instructions>
<shipment-Method-Payment>PP</shipment-Method-Payment>
<Location-Qualifier>US</Location-Qualifier>
<Description>free from text Desctiption</Description>
<Transportation-Terms-Qualifier-Code>QualifierCode</Transportation-Terms-Qualifier-Code>
<Transportation-Terms-Code>TradeTerms</Transportation-Terms-Code>
</Fob-Instructions>
<Date-Time-Reference>
<date-Time-qualifier>002</date-Time-qualifier>
<date>20210605</date>
</Date-Time-Reference>
<Date-Time-Reference>
<date-Time-qualifier>010</date-Time-qualifier>
<date>20210528</date>
</Date-Time-Reference>
<Date-Time-Reference>
<date-Time-qualifier>177</date-Time-qualifier>
<date>20130606</date>
</Date-Time-Reference>
<Reference-Identification>
<Reference-Identification-Qualifier>L1</Reference-Identification-Qualifier>
<Reference-Identification>PO COMMENTS</Reference-Identification>
<Free-form-Description>Free form description</Free-form-Description>
</Reference-Identification>
<Message-Text>
<Free-Form-Message-Text>THIS PO SUBJECT TO THE TERMS AND CONDITIONS FOUND ON CVS SUPPLIERS WEBSITE
</Free-Form-Message-Text>
</Message-Text>
<Name>
<Entity-Identifier-Code>ST</Entity-Identifier-Code>
<Name>someone</Name>
<Identification-Code-Qualifier>54</Identification-Code-Qualifier>
<Identification-Code>Y101</Identification-Code>
</Name>
<Additional-Name-Information>
<Name>free from name</Name>
</Additional-Name-Information>
<Geographic-Location>
<City-Name>WAVERLY</City-Name>
<n402></n402>
<n403></n403>
<n404></n404>
<location-qualifier>NY</location-qualifier>
<Location-Identifier>14892</Location-Identifier>
</Geographic-Location>
<Carrier-Details>
<TD01></TD01>
<TD02></TD02>
<TD03></TD03>
<Transportation-Method>H</Transportation-Method>
<TD05></TD05>
</Carrier-Details>
</PO><PO>
<Name>
<Entity-Identifier-Code>bt</Entity-Identifier-Code>
<Name>billName</Name>
<Identification-Code-Qualifier>54</Identification-Code-Qualifier>
<Identification-Code>Y101</Identification-Code>
</Name>
<Additional-Name-Information>
<Name>free from name</Name>
</Additional-Name-Information>
<Geographic-Location>
<City-Name>WAVERLY</City-Name>
<n402></n402>
<n403></n403>
<n404></n404>
<location-qualifier>NY</location-qualifier>
<Location-Identifier>14892</Location-Identifier>
</Geographic-Location>
<Carrier-Details>
<TD01></TD01>
<TD02></TD02>
<TD03></TD03>
<Transportation-Method>H</Transportation-Method>
<TD05></TD05>
</Carrier-Details>
<Baseline-Item-Data>
<PO101></PO101>
<Quantity-Ordered>1</Quantity-Ordered>
<Unit-Measurement>CA</Unit-Measurement>
<Unit-Price>57.6</Unit-Price>
<Basis-of-Unit-Price-Code>CP</Basis-of-Unit-Price-Code>
<Product-Service-ID-Qualifier-one>UA</Product-Service-ID-Qualifier-one>
<Product-Service-ID>999999</Product-Service-ID>
<Product-Service-ID-Qualifier-Code>IN</Product-Service-ID-Qualifier-Code>
<Product-Service-ID-code>099999999999</Product-Service-ID-code>
<PO110>VN</PO110>
<PO111>099999999991</PO111>
<PO112></PO112>
<PO113></PO113>
<PO114></PO114>
<PO115></PO115>
<PO116></PO116>
<PO117></PO117>
<PO118></PO118>
<PO119></PO119>
<PO120></PO120>
<PO121></PO121>
<PO122></PO122>
<PO123></PO123>
<Product-Service-ID-Qualifier>UK</Product-Service-ID-Qualifier>
<Product-Service-D>125438245689784</Product-Service-D>
</Baseline-Item-Data>
<Product-Item-Description>
<Item-Description-Type>F</Item-Description-Type>
<PID02></PID02>
<PID03></PID03>
<PID04></PID04>
<Description>FreeTextDescription</Description>
</Product-Item-Description>
<Allowance-or-Charge-Information>
<Allowance-or-Charge-Indicator>A</Allowance-or-Charge-Indicator>
<Service-Promotion-Allowance-or-Charge-Code>C1310</Service-Promotion-Allowance-or-Charge-Code>
<SAC03></SAC03>
<SAC04></SAC04>
<SAC05></SAC05>
<SAC06></SAC06>
<SAC07></SAC07>
<Rate>0</Rate>
<SAC9></SAC9>
<SAC10></SAC10>
<SAC11></SAC11>
<Allowance-Charge-Method-f-Handling-Code></Allowance-Charge-Method-f-Handling-Code>
</Allowance-or-Charge-Information>
<Allowance-or-Charge-Information>
<Allowance-or-Charge-Indicator>C</Allowance-or-Charge-Indicator>
<Service-Promotion-Allowance-or-Charge-Code>C1310</Service-Promotion-Allowance-or-Charge-Code>
<SAC03></SAC03>
<SAC04></SAC04>
<SAC05></SAC05>
<SAC06></SAC06>
<SAC07></SAC07>
<Rate>0</Rate>
<SAC9></SAC9>
<SAC10></SAC10>
<SAC11></SAC11>
<Allowance-Charge-Method-f-Handling-Code></Allowance-Charge-Method-f-Handling-Code>
</Allowance-or-Charge-Information>
<Transaction-Totals>
<Number-of-Line-Items>1</Number-of-Line-Items>
<CTT02></CTT02>
<Weight>75.0</Weight>
<Unit-or-Basis-for-Measurement-Code>UN</Unit-or-Basis-for-Measurement-Code>
<Volume>222</Volume>
<Unit-or-Basis-for-Measurement-Cod>CF</Unit-or-Basis-for-Measurement-Cod>
</Transaction-Totals>
<Monetary-Amount>
<Amount-Qualifier-ode>TT</Amount-Qualifier-ode>
<Monetary-Amount>4320</Monetary-Amount>
</Monetary-Amount>
<Transaction-Set-Trailer>
<Number-of-Included-Segments>20</Number-of-Included-Segments>
<Transaction-Set-Control-Number>179960</Transaction-Set-Control-Number>
</Transaction-Set-Trailer>
<functional-group-end>
<GE01>38</GE01>
<GE2>5850</GE2>
</functional-group-end>
<interchange-control-trailer>
<functional-groups-involved>1</functional-groups-involved>
<control-numbers>000010952</control-numbers>
</interchange-control-trailer>
</PO>

but im expecting this

<PO>
<interchange-Control-Header>
<Authorization-Information-Qualifier>00</Authorization-Information-Qualifier>
<Authorization-Information></Authorization-Information>
<Security-Information-Qualifier>00</Security-Information-Qualifier>
<Security-Information></Security-Information>
<Interchange-ID-Qualifier-code>ZZ</Interchange-ID-Qualifier-code>
<Interchange-Sender-ID>CVS</Interchange-Sender-ID>
<Interchange-ID-Qualifier>01</Interchange-ID-Qualifier>
<Interchange-Receiver-ID>Supplier ID</Interchange-Receiver-ID>
<Interchange-Date>130212</Interchange-Date>
<Interchange-Time>1608</Interchange-Time>
<Interchange-Control-Standards-Identifier>U</Interchange-Control-Standards-Identifier>
<Interchange-Control-Version-Number>00401</Interchange-Control-Version-Number>
<Interchange-Control-Number>000010952</Interchange-Control-Number>
<Acknowledgement-Requested>0</Acknowledgement-Requested>
<Usage-Indicator>P</Usage-Indicator>
<Component-Element-Separator>^</Component-Element-Separator>
</interchange-Control-Header>
<Group-Header>
<Functional-Code-Identifier>PO</Functional-Code-Identifier>
<Application-Senders-Code>CVS</Application-Senders-Code>
<Application-Receivers-Code>Supplier ID</Application-Receivers-Code>
<Date>20130212</Date>
<Time>1608</Time>
<Group-Control-Number>5850</Group-Control-Number>
<Responsible-Agency-Code>X</Responsible-Agency-Code>
<Version-Release-Industry-Identifier-Code>004010</Version-Release-Industry-Identifier-Code>
</Group-Header>
<transaction-Set>
<transaction-code>850</transaction-code>
<transaction-set-control-number>179960</transaction-set-control-number>
</transaction-Set>
<beginning-segment>
<purpose-code>00</purpose-code>
<Po-type>NE</Po-type>
<Po-Number>9999999</Po-Number>
<empty></empty>
<Date>20130212</Date>
</beginning-segment>
<Fob-Instructions>
<shipment-Method-Payment>PP</shipment-Method-Payment>
<Location-Qualifier>US</Location-Qualifier>
<Description>free from text Desctiption</Description>
<Transportation-Terms-Qualifier-Code>QualifierCode</Transportation-Terms-Qualifier-Code>
<Transportation-Terms-Code>TradeTerms</Transportation-Terms-Code>
</Fob-Instructions>
<Date-Time-Reference>
<date-Time-qualifier>002</date-Time-qualifier>
<date>20210605</date>
</Date-Time-Reference>
<Date-Time-Reference>
<date-Time-qualifier>010</date-Time-qualifier>
<date>20210528</date>
</Date-Time-Reference>
<Date-Time-Reference>
<date-Time-qualifier>177</date-Time-qualifier>
<date>20130606</date>
</Date-Time-Reference>
<Reference-Identification>
<Reference-Identification-Qualifier>L1</Reference-Identification-Qualifier>
<Reference-Identification>PO COMMENTS</Reference-Identification>
<Free-form-Description>Free form description</Free-form-Description>
</Reference-Identification>
<Message-Text>
<Free-Form-Message-Text>THIS PO SUBJECT TO THE TERMS AND CONDITIONS FOUND ON CVS SUPPLIERS WEBSITE
</Free-Form-Message-Text>
</Message-Text>
<Name>
<Entity-Identifier-Code>ST</Entity-Identifier-Code>
<Name>someone</Name>
<Identification-Code-Qualifier>54</Identification-Code-Qualifier>
<Identification-Code>Y101</Identification-Code>
</Name>
<Additional-Name-Information>
<Name>free from name</Name>
</Additional-Name-Information>
<Geographic-Location>
<City-Name>WAVERLY</City-Name>
<n402></n402>
<n403></n403>
<n404></n404>
<location-qualifier>NY</location-qualifier>
<Location-Identifier>14892</Location-Identifier>
</Geographic-Location>
<Carrier-Details>
<TD01></TD01>
<TD02></TD02>
<TD03></TD03>
<Transportation-Method>H</Transportation-Method>
<TD05></TD05>
</Carrier-Details>
<Name>
<Entity-Identifier-Code>bt</Entity-Identifier-Code>
<Name>billName</Name>
<Identification-Code-Qualifier>54</Identification-Code-Qualifier>
<Identification-Code>Y101</Identification-Code>
</Name>
<Additional-Name-Information>
<Name>free from name</Name>
</Additional-Name-Information>
<Geographic-Location>
<City-Name>WAVERLY</City-Name>
<n402></n402>
<n403></n403>
<n404></n404>
<location-qualifier>NY</location-qualifier>
<Location-Identifier>14892</Location-Identifier>
</Geographic-Location>
<Carrier-Details>
<TD01></TD01>
<TD02></TD02>
<TD03></TD03>
<Transportation-Method>H</Transportation-Method>
<TD05></TD05>
</Carrier-Details>
<Baseline-Item-Data>
<PO101></PO101>
<Quantity-Ordered>1</Quantity-Ordered>
<Unit-Measurement>CA</Unit-Measurement>
<Unit-Price>57.6</Unit-Price>
<Basis-of-Unit-Price-Code>CP</Basis-of-Unit-Price-Code>
<Product-Service-ID-Qualifier-one>UA</Product-Service-ID-Qualifier-one>
<Product-Service-ID>999999</Product-Service-ID>
<Product-Service-ID-Qualifier-Code>IN</Product-Service-ID-Qualifier-Code>
<Product-Service-ID-code>099999999999</Product-Service-ID-code>
<PO110>VN</PO110>
<PO111>099999999991</PO111>
<PO112></PO112>
<PO113></PO113>
<PO114></PO114>
<PO115></PO115>
<PO116></PO116>
<PO117></PO117>
<PO118></PO118>
<PO119></PO119>
<PO120></PO120>
<PO121></PO121>
<PO122></PO122>
<PO123></PO123>
<Product-Service-ID-Qualifier>UK</Product-Service-ID-Qualifier>
<Product-Service-D>125438245689784</Product-Service-D>
</Baseline-Item-Data>
<Product-Item-Description>
<Item-Description-Type>F</Item-Description-Type>
<PID02></PID02>
<PID03></PID03>
<PID04></PID04>
<Description>FreeTextDescription</Description>
</Product-Item-Description>
<Allowance-or-Charge-Information>
<Allowance-or-Charge-Indicator>A</Allowance-or-Charge-Indicator>
<Service-Promotion-Allowance-or-Charge-Code>C1310</Service-Promotion-Allowance-or-Charge-Code>
<SAC03></SAC03>
<SAC04></SAC04>
<SAC05></SAC05>
<SAC06></SAC06>
<SAC07></SAC07>
<Rate>0</Rate>
<SAC9></SAC9>
<SAC10></SAC10>
<SAC11></SAC11>
<Allowance-Charge-Method-f-Handling-Code></Allowance-Charge-Method-f-Handling-Code>
</Allowance-or-Charge-Information>
<Allowance-or-Charge-Information>
<Allowance-or-Charge-Indicator>C</Allowance-or-Charge-Indicator>
<Service-Promotion-Allowance-or-Charge-Code>C1310</Service-Promotion-Allowance-or-Charge-Code>
<SAC03></SAC03>
<SAC04></SAC04>
<SAC05></SAC05>
<SAC06></SAC06>
<SAC07></SAC07>
<Rate>0</Rate>
<SAC9></SAC9>
<SAC10></SAC10>
<SAC11></SAC11>
<Allowance-Charge-Method-f-Handling-Code></Allowance-Charge-Method-f-Handling-Code>
</Allowance-or-Charge-Information>
<Transaction-Totals>
<Number-of-Line-Items>1</Number-of-Line-Items>
<CTT02></CTT02>
<Weight>75.0</Weight>
<Unit-or-Basis-for-Measurement-Code>UN</Unit-or-Basis-for-Measurement-Code>
<Volume>222</Volume>
<Unit-or-Basis-for-Measurement-Cod>CF</Unit-or-Basis-for-Measurement-Cod>
</Transaction-Totals>
<Monetary-Amount>
<Amount-Qualifier-ode>TT</Amount-Qualifier-ode>
<Monetary-Amount>4320</Monetary-Amount>
</Monetary-Amount>
<Transaction-Set-Trailer>
<Number-of-Included-Segments>20</Number-of-Included-Segments>
<Transaction-Set-Control-Number>179960</Transaction-Set-Control-Number>
</Transaction-Set-Trailer>
<functional-group-end>
<GE01>38</GE01>
<GE2>5850</GE2>
</functional-group-end>
<interchange-control-trailer>
<functional-groups-involved>1</functional-groups-involved>
<control-numbers>000010952</control-numbers>
</interchange-control-trailer>
</PO>



does someone know why does the PO tag is closing after the Carrier-Details and then open again ? this is a single purchase order and i wasn't expecting that behaviour, am i missing something on the mapping configuration?

Claude

unread,
May 17, 2021, 1:26:28 PMMay 17
to Smooks Users
At first glance, I'd say that the X12 loops are not modelled properly in your DFDL schema. The parser thinks that the N1 segment's second occurence identifies the start of another PO element because a second N1 segment is not expected after the TD5 segment.

Claude
Reply all
Reply to author
Forward
0 new messages