Author |
Message
|
marquies |
Posted: Fri Apr 22, 2016 6:14 am Post subject: Ignore blank space elements in DFDL parser |
|
|
Novice
Joined: 01 Feb 2012 Posts: 15
|
Hello Everyone.
Request your inputs on my following query:
Is it possible to ignore blank value elements in DFDL parsing that are optional in nature and having data type string i.e. The DFDL parsing for optional elements with blank space should be same as parsing the optional element that is not present in the input.
Kindly
Thank you |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 22, 2016 6:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Yes, it's possible.
Lots of discussion here about all kinds of situations with modelling data using DFDL. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
marquies |
Posted: Fri Apr 22, 2016 6:38 am Post subject: |
|
|
Novice
Joined: 01 Feb 2012 Posts: 15
|
Thanks mqjeff.
Can you please help me on how to achieve it? i.e. how and what properties to be set..
Links or notes or any material briefing on the same will be helpful.
Thank you. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 22, 2016 6:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I can't tell you how to do it.
It depends entirely on the structure of your message.
As I said, there's lots of discussion here about modelling data with DFDL. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
marquies |
Posted: Fri Apr 22, 2016 6:43 am Post subject: |
|
|
Novice
Joined: 01 Feb 2012 Posts: 15
|
Ok, no issues. I'll try to search for the same here.
Thanks. |
|
Back to top |
|
 |
timber |
Posted: Fri Apr 22, 2016 3:48 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
The DFDL parsing for optional elements with blank space should be same as parsing the optional element that is not present in the input. |
If the optional element occupies at least one byte in the input message ( even if that byte is a space character ) then according to the DFDL specification the element exists. That's a technical term, not just my opinion .
You can tell the DFDL parser to treat the all-spaces value as a nil value. That will produce an ESQL NULL value in the message tree when the input is filled with spaces. |
|
Back to top |
|
 |
marquies |
Posted: Mon Apr 25, 2016 1:13 am Post subject: |
|
|
Novice
Joined: 01 Feb 2012 Posts: 15
|
Thanks Timber.
Yes, I agree with you. But I want to tell the DFDL parser to delete the optional element, if it is a blank space, instead of treating it as NULL. Is it possible? |
|
Back to top |
|
 |
timber |
Posted: Mon Apr 25, 2016 1:47 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
I want to tell the DFDL parser to delete the optional element, if it is a blank space, instead of treating it as NULL. Is it possible? |
No. Technically, your requirement is for conditional mapping ( deleting elements with a particular value ) not parsing. I understand that this feature would be useful for you, but
a) DFDL's scope has to stop somewhere and
b) it's not actually very hard to code around this problem. |
|
Back to top |
|
 |
manoj5007 |
Posted: Tue Apr 26, 2016 8:37 am Post subject: |
|
|
 Acolyte
Joined: 15 May 2013 Posts: 64
|
Marquies,
By default, DFDL doesn't construct optional values with null.
While parsing, the element will not be formed in the logical tree. |
|
Back to top |
|
 |
|