|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DFDL Parser issue with delimited data |
« View previous topic :: View next topic » |
Author |
Message
|
Rani143 |
Posted: Mon Sep 22, 2014 7:47 am Post subject: DFDL Parser issue with delimited data |
|
|
Newbie
Joined: 15 Sep 2014 Posts: 3
|
Hello,
I have created an XSD using DFDL domain. Its working fine.
But For a Scenario like if 3 elemens are present in XSD and tab is missing for 2nd element then 3rd value is getting assigned to 2nd element and also its not failing.
EX:- Name,Id,Data are present in XSD and input is Rani(Tab)MQ; In the input Id value is missing and i want throw as invali data.But MQ got assigned to Id and its not failing.
Can you please help me to resolve this.  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 22, 2014 7:57 am Post subject: Re: DFDL Parser issue with delimited data |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Rani143 wrote: |
Can you please help me to resolve this.  |
Post your DFDL schema and the results of a DFDL trace with the invalid data.
Then we'll be able to help you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 22, 2014 8:00 am Post subject: Re: DFDL Parser issue with delimited data |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Rani143 wrote: |
EX:- Name,Id,Data are present in XSD and input is Rani(Tab)MQ; In the input Id value is missing and i want throw as invali data.But MQ got assigned to Id and its not failing. |
Also, and for the record, it's behaving as designed. If you have 3 fields with tab delimiters and only provide 2 items, of course it's going to assign the 3rd to the 2nd - how does it know that's supposed to be the 3rd?
The question is why it's not complaining that there are not 3 elements. Your schema will illuminate this. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Sep 24, 2014 12:19 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Name,Id,Data are present in XSD and input is Rani(Tab)MQ; In the input Id value is missing and i want throw as invali data.But MQ got assigned to Id and its not failing. |
Vitor is correct. You need to set separatorSuppressionPolicy to 'never' on the parent group. That will force the DFDL parser to complain if any fields are missing. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
shanson |
Posted: Wed Sep 24, 2014 3:40 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
If you would like DFDL to fail specifically because the content of element 'Id' is incorrect, then you can use a DFDL assert or discriminator on 'Id' that checks its value. So if it is missing and the content of 'Data' gets read into that 'Id', you will get an error. That all assumes that 'Id' and 'Data' can be distinguished. |
|
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
|
|
|
|