|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Help needed on DFDL - conditional repeating CSV elements |
« View previous topic :: View next topic » |
Author |
Message
|
harish_td |
Posted: Wed Oct 21, 2015 1:07 pm Post subject: Help needed on DFDL - conditional repeating CSV elements |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Hello,
I have a use case where CSV data arrives in the following format.
Elements A and B are simple elements. The third element (count) signals how many occurrences there are of the succeeding elements. After all occurrences are presented a CRLF signals the end of the record.
Code: |
A1, B1,2, C1, C2
A2,B2,3,C1,C2,C3
A3,B3,1,C1
A4,B4,0
|
The Occurs Count of the C group is set to Expression and the XPath of the 3rd element. I easily got this to work by extending the CSV sample that ships with the toolkit.
The DFDL parser ignores the CRLF and goes on to the second record. How do I indicate that the CRLF should not be treated as part of the C group?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Oct 21, 2015 7:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't make it part of the C group. Make it be the record terminator...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 22, 2015 5:13 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
DFDL also has a "group terminator". But I don't remember what it's actually called (it might simply be group terminator).
Record terminator is better if there won't be any fields after the C group. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
timber |
Posted: Thu Oct 22, 2015 7:03 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
In DFDL it's just called a 'terminator' whether it is on a group or an element.
I agree that modelling the line-end character(s) as a terminator is a best way forward. |
|
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
|
|
|
|