|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using a discriminator with a separation character |
« View previous topic :: View next topic » |
Author |
Message
|
petervh1 |
Posted: Thu Aug 15, 2024 1:23 am Post subject: Using a discriminator with a separation character |
|
|
Centurion
Joined: 19 Apr 2010 Posts: 135
|
Hi
I'm trying to model this data:
Code: |
002|1|20240801|2a26dd82-5533-4fcd-9da5-082a3c6f6f42|655|HX TOKAI POS|44.38|44.38|202408016551005218|0.00
|003|6009522300135|PASTA FATTIS&MONIS 500G, SCREWS|10140458|10321004|44.38|1|2
002|1|20240801|2bdb900e-740e-4f5a-9f3a-fab834574542|655|HX TOKAI POS|37.98|37.98|202408016551005219|0.00
|003|6001097895108|COCONUT MILK SHOGUN 165G BOTTLE|10138400|10320206|37.98|1|2
002|1|20240801|2a26dd82-5533-4fcd-9da5-082a3c6f6f42|655|HX TOKAI POS|27.98|27.98|2024080165510052110|0.00
|003|6001097895108|COCONUT MILK SHOGUN 165G BOTTLE|10138400|10320206|27.98|1|2
002|4|20240801|033d8e13-d099-4781-94f5-2e6224995048|655|HX TOKAI POS|675.34|154.36|2024080165510052122|0.00
|003||NON FOOD ITEM||50500108|399.99|0|1
|003|5701116214293|JAM RASPBERRY DANISH CHOICE 454G JAR|10138067|10320503|109.98|1|2 |
My XSD looks like this:
Code: |
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:csv="http://www.ibm.com/dfdl/CommaSeparatedFormat" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions">
<xsd:import namespace="http://www.ibm.com/dfdl/CommaSeparatedFormat" schemaLocation="IBMdefined/CommaSeparatedFormat.xsd"/>
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format documentFinalTerminatorCanBeMissing="yes" encoding="{$dfdl:encoding}" escapeSchemeRef="csv:CSVEscapeScheme" ref="csv:CommaSeparatedFormat"/>
<dfdl:defineEscapeScheme name="PipeEscapeScheme">
<dfdl:escapeScheme escapeBlockEnd="003" escapeBlockStart="|" escapeCharacter="|" escapeEscapeCharacter="" escapeKind="escapeBlock" extraEscapedCharacters="%SP;" generateEscapeBlock="whenNeeded"/>
</dfdl:defineEscapeScheme>
</xsd:appinfo>
</xsd:annotation>
<xsd:element ibmSchExtn:docRoot="true" name="CustomerSales_I_Purchase">
<xsd:complexType>
<xsd:sequence dfdl:separator="">
<xsd:element dfdl:occursCountKind="implicit" dfdl:terminator="%CR;%LF;" maxOccurs="unbounded" name="Purchase_header_record">
<xsd:complexType>
<xsd:sequence>
<xsd:element fixed="002" ibmDfdlExtn:sampleValue="value1" name="Record_id" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:discriminator>{fn:contains (. ,'002' )}</dfdl:discriminator>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element ibmDfdlExtn:sampleValue="value2" name="No_of_items" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value3" name="Trn_date" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value4" name="Client_Account_Number" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value5" name="Branch_cd" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value6" name="Branch_name" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." name="Trn_amt" type="xsd:decimal"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." name="Spend_amt" type="xsd:decimal"/>
<xsd:element ibmDfdlExtn:sampleValue="value9" name="Trn_id" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." name="Card_spend_amt" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:occursCountKind="implicit" dfdl:terminator="%CR;%LF;" maxOccurs="unbounded" name="Purchase_detail_record">
<xsd:complexType>
<xsd:sequence>
<xsd:element dfdl:escapeSchemeRef="PipeEscapeScheme" ibmDfdlExtn:sampleValue="value1" name="Record_id" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:discriminator>{fn:contains (. ,'|003' )}</dfdl:discriminator>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element ibmDfdlExtn:sampleValue="value2" name="Article_barcode" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value3" name="Article_descr" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value4" name="Article_id" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value5" name="BMC" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." name="Article_price" type="xsd:decimal"/>
<xsd:element ibmDfdlExtn:sampleValue="value8" name="Vit_category" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="value9" name="Quantity" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
The last part of the DFDL trace shows:[quote]15 Aug 2024, 11:08:19 info: Offset: 99. Found separator '|' owned by the 'sequence' group contained within element 'Purchase_header_record'.
Code: |
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence), 120]
15 Aug 2024, 11:08:19 info: Offset: 100. Starting to process element 'Card_spend_amt'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Card_spend_amt), 76]
15 Aug 2024, 11:08:19 info: Offset: 100. Found delimited value '0.00' for element 'Card_spend_amt'. The delimiter was '%CR;%LF;'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Card_spend_amt), 120]
15 Aug 2024, 11:08:19 info: Offset: 104. The simple content region of element 'Card_spend_amt' was converted to logical value '0'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Card_spend_amt), 123]
15 Aug 2024, 11:08:19 info: Offset: 104. Finished processing element 'Card_spend_amt'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Card_spend_amt), 76]
15 Aug 2024, 11:08:19 info: Offset: 104. Found terminator '%CR;%LF;' for 'Purchase_header_record'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record), 78]
15 Aug 2024, 11:08:19 info: Offset: 106. Finished processing element 'Purchase_header_record'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record), 74]
15 Aug 2024, 11:08:19 info: Offset: 106. Optional element 'Purchase_header_record' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record), 170]
15 Aug 2024, 11:08:19 info: Offset: 106. Starting to process element 'Purchase_header_record'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record), 74]
15 Aug 2024, 11:08:19 info: Offset: 106. Starting to process element 'Record_id'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 61]
15 Aug 2024, 11:08:19 info: Offset: 106. Element 'Record_id' is empty because the content region is empty.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 86]
15 Aug 2024, 11:08:19 info: Offset: 106. Found delimited value '' for element 'Record_id'. The delimiter was '|'.
[dfdl = /CustomerSales/CustomerSales_I_Purchase.xsd, scd = #xscd(/schemaElement::CustomerSales_I_Purchase/type::0/model::sequence/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 94]
15 Aug 2024, 11:08:19 fatal: CTDP3108E: When parsing, the IBM DFDL processor does not support an empty or missing element with a default value. |
As I see it, the issue is that there is a problem using the pipe character (|) as the first byte of the second line of data (|003). I set up an escape scheme to esacpe the pipe character for this field, buit I still get the error as shown iin the DFDL trace.
Can anyone asist?
TIA |
|
Back to top |
|
 |
timber |
Posted: Sat Aug 24, 2024 6:48 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
I think I can make a suggestion. Good question btw - all the required info is right there.
First, the error message. The element 'Record_id' has a fixed value. This is an XML schema attribute, and it works exactly like a default value except that the value of the element/attribute must equal the fixed value else it is a validation error. Therefore (by the rules of XML Schema) Record_id has a default value even though you have not explicitly defined one.
You are correct that DFDL is getting confused by the pipe character at the start of the line. However, DFDL is very flexible, and you don't have to treat the 1st 4 characters of every line as a delimited field. You have a number of options:
a) Change dfdl:lengthKind="fixed" and set dfdl:length="4". And don't forget to specify dfdl:lengthKind="characters' just to be safe.
You will need to change lengthKind to 'implicit' for the enclosing sequence, and then wrap the remaining elements of the sequence in a new sequence with lengthKind="delimited' and dfdl:separator="|".
b) I think this is simpler...
Add a dfdl:initiator to Purchase_header_record and Purchase_detail_record.
Make sure to include all 4 characters in the initiator values (i.e. include the pipe symbol in both initiators).
I haven't tested either solution, but I think they should work. |
|
Back to top |
|
 |
petervh1 |
Posted: Tue Aug 27, 2024 12:56 am Post subject: |
|
|
Centurion
Joined: 19 Apr 2010 Posts: 135
|
Thanks for the reply. I managed to get solution b) working.
I forgot to mention that I also need the initiator fields ('002|' and '003|') to be parsed (ie they form part of the input data stream) so that I can map them in the next stage.
Is there a setting that allows me to do this? |
|
Back to top |
|
 |
timber |
Posted: Mon Sep 02, 2024 7:59 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
I forgot to mention that I also need the initiator fields ('002|' and '003|') to be parsed (ie they form part of the input data stream) so that I can map them in the next stage.
Is there a setting that allows me to do this? |
No. The initiators, delimiters and terminators are all markup and they never appear in the message tree. You can just map them as fixed values instead of taking their value from the input message tree. |
|
Back to top |
|
 |
petervh1 |
Posted: Tue Sep 03, 2024 9:58 pm Post subject: |
|
|
Centurion
Joined: 19 Apr 2010 Posts: 135
|
I implemented what I understand to be your suggestion, but I still get an error.
My XSD is now:
Code: |
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:csv="http://www.ibm.com/dfdl/CommaSeparatedFormat" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions">
<xsd:import namespace="http://www.ibm.com/dfdl/CommaSeparatedFormat" schemaLocation="IBMdefined/CommaSeparatedFormat.xsd"/>
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format documentFinalTerminatorCanBeMissing="yes" encoding="{$dfdl:encoding}" escapeSchemeRef="csv:CSVEscapeScheme" ref="csv:CommaSeparatedFormat"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:element ibmSchExtn:docRoot="true" name="VitalityCustomerSales_I">
<xsd:complexType>
<xsd:sequence dfdl:separator="">
<xsd:element dfdl:terminator="%CR;%LF;" name="Header">
<xsd:complexType>
<xsd:sequence>
<xsd:element fixed="001" ibmDfdlExtn:sampleValue="head_value1" name="Record_id" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="head_value2" name="Name" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="head_value3" name="Extract_Date" type="xsd:string"/>
<xsd:element ibmDfdlExtn:sampleValue="head_value4" name="Extract_Number" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:lengthKind="delimited" dfdl:occursCountKind="implicit" dfdl:terminator="%CR;%LF;" maxOccurs="unbounded" name="Purchase_info">
<xsd:complexType>
<xsd:sequence dfdl:separator="%#124;">
<xsd:choice dfdl:initiatedContent="yes">
<xsd:element dfdl:emptyValueDelimiterPolicy="initiator" dfdl:initiator="002|" name="Purchase_header_record">
<xsd:complexType>
<xsd:sequence>
<xsd:element fixed="002" minOccurs="0" name="Record_id" type="xsd:string"/>
<xsd:element dfdl:fillByte="" dfdl:nilKind="literalValue" dfdl:nilValue="%SP;" dfdl:useNilForDefault="yes" minOccurs="0" name="No_of_items" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="Trn_date" type="xsd:string"/>
<xsd:element minOccurs="0" name="Client_Account_Number" type="xsd:string"/>
<xsd:element minOccurs="0" name="Branch_cd" type="xsd:string"/>
<xsd:element minOccurs="0" name="Branch_name" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." minOccurs="0" name="Trn_amt" type="xsd:decimal"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." minOccurs="0" name="Healthy_spend_amt" type="xsd:decimal"/>
<xsd:element minOccurs="0" name="Trn_id" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." minOccurs="0" name="Discovery_card_spend_amt" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:emptyValueDelimiterPolicy="initiator" dfdl:initiator="003|" name="Purchase_detail_record">
<xsd:complexType>
<xsd:sequence>
<xsd:element fixed="003" minOccurs="0" name="Record_id" type="xsd:string"/>
<xsd:element minOccurs="0" name="Article_barcode" type="xsd:string"/>
<xsd:element minOccurs="0" name="Article_descr" type="xsd:string"/>
<xsd:element minOccurs="0" name="Article_id" type="xsd:string"/>
<xsd:element minOccurs="0" name="BMC" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." minOccurs="0" name="Article_price" type="xsd:decimal"/>
<xsd:element minOccurs="0" name="VIT_category" type="xsd:string"/>
<xsd:element minOccurs="0" name="Quantity" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:terminator="%CR;%LF;" name="Trailer">
<xsd:complexType>
<xsd:sequence>
<xsd:element fixed="999" name="Record_id" type="xsd:string"/>
<xsd:element name="No_of_lines" type="xsd:string"/>
<xsd:element dfdl:textNumberPattern="#0.0" dfdl:textStandardDecimalSeparator="." minOccurs="1" name="HashTotal" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
The rellevant part of the DFDL trace shows:
Code: |
04 Sep 2024, 07:48:06 info: Offset: 47. Up to 'unbounded' occurrences of element 'Purchase_info' will be expected because occursCountKind='implicit' and maxOccurs='unbounded'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info), 155]
04 Sep 2024, 07:48:06 info: Offset: 47. Starting to process element 'Purchase_info'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info), 64]
04 Sep 2024, 07:48:06 info: Offset: 47. Found text initiator '002|' for the choice group within element 'Purchase_info'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice), 100]
04 Sep 2024, 07:48:06 info: Offset: 47. Starting to process element 'Purchase_header_record'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record), 73]
04 Sep 2024, 07:48:06 info: Offset: 47. Found initiator '002|' for 'Purchase_header_record'
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record), 71]
04 Sep 2024, 07:48:06 info: Offset: 51. Optional element 'Record_id' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 156]
04 Sep 2024, 07:48:06 info: Offset: 51. Starting to process element 'Record_id'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 60]
04 Sep 2024, 07:48:06 info: Offset: 51. Found delimited value '3' for element 'Record_id'. The delimiter was '|'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 94]
04 Sep 2024, 07:48:06 info: Offset: 52. Finished processing element 'Record_id'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::Record_id), 60]
04 Sep 2024, 07:48:06 info: Offset: 52. Optional element 'No_of_items' encountered. The DFDL parser will return to this position if the element is not present in the data stream.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::No_of_items), 158]
04 Sep 2024, 07:48:06 info: Offset: 52. Found separator '|' owned by the 'sequence' group contained within element 'Purchase_header_record'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence), 120]
04 Sep 2024, 07:48:06 info: Offset: 53. Starting to process element 'No_of_items'.
[dfdl = /VitalityCustomerSales/VitalityCustomerSales_I.xsd, scd = #xscd(/schemaElement::VitalityCustomerSales_I/type::0/model::sequence/schemaElement::Purchase_info/type::0/model::sequence/model::choice/schemaElement::Purchase_header_record/type::0/model::sequence/schemaElement::No_of_items), 62]
|
The first part of the data I'm mapping is;
Code: |
001|TRANSACTION FILE|20240830|000005
002|3|20240830|000137Q8|9186|HC EDEN MEANDER POS|285.94|0.00|202408309186100530145|0.00
|003||NON FOOD ITEM||50490110|25.98|0|2
|
As I understand it, the first element (Record_id) is being ignored, so this element is being mapped to a value of '3', which is the value of the second element in that record. I want the Record_id element to be mapped to the value of 002. |
|
Back to top |
|
 |
timber |
Posted: Wed Sep 04, 2024 6:42 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
You're nearly there. You cannot parse the same data '002|' as an initiator and then again as the content of element 'Record_id'. You need to delete the Record_id elements from your DFDL model.
I know you said that you want Record_id in the message tree. I did respond to that in my previous answer. Feel free to explain why having Record_id in the message tree is important. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 05, 2024 6:10 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
timber wrote: |
You're nearly there. You cannot parse the same data '002|' as an initiator and then again as the content of element 'Record_id'. You need to delete the Record_id elements from your DFDL model.
I know you said that you want Record_id in the message tree. I did respond to that in my previous answer. Feel free to explain why having Record_id in the message tree is important. |
Would it work if he used it as discriminator instead of initiator?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
timber |
Posted: Fri Sep 06, 2024 1:58 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
Would it work if he used it as discriminator instead of initiator? |
Yes, that's option a) from my reply on 24th August. But using an initiator is usually simpler, and it usually does not make the mappings any more difficult. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|