ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Define a default value for a nil value in DFDL Schema

Post new topic  Reply to topic
 Define a default value for a nil value in DFDL Schema « View previous topic :: View next topic » 
Author Message
digoshc
PostPosted: Mon Nov 11, 2013 3:02 am    Post subject: Define a default value for a nil value in DFDL Schema Reply with quote

Apprentice

Joined: 11 Jul 2013
Posts: 25

Hi,

Is it possible to define a default value for a nil value in a DFDL Schema? For example, I do have a field in a record oriented text where it can have the following values: @Value@ or NULL.

The @ is the initiator and the terminator delimiter of the field, however, it will not be present if the value is NULL. So, I was thinking to use the dfdl:nilValueDelimiterPolicy=none and define the default value of a nil to NULL. Is that possible?

Env: WMB 8.0.0.2|Windows
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Nov 11, 2013 3:56 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

A simple search for

DFDL Default Value

will give you a lot of information
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Nov 11, 2013 4:02 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I was thinking to use the dfdl:nilValueDelimiterPolicy=none and define the default value of a nil to NULL. Is that possible?
Yes - you have correctly understood what the nilValueDelimitedPolicy is for. If the input data contain the string 'NULL' then the message tree will contain the value NULL. Otherwise, the input field must have the initiator and terminator of '@'.
_________________
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
View user's profile Send private message
digoshc
PostPosted: Mon Nov 11, 2013 5:05 am    Post subject: Reply with quote

Apprentice

Joined: 11 Jul 2013
Posts: 25

@kimbert: well, the Test Parse Model(DFDL Schema Editor) does not behave as you described or I'm missing something. My test:

the input: NULL

the element defined:
<xsd:element default="NULL" dfdl:initiator="@" dfdl:nilValueDelimiterPolicy="none" dfdl:terminator="@" ibmDfdlExtn:sampleValue="NULL" name="XXXXX" type="xsd:string"/>

the error log:
CTDP3041E: Initiator '@' not found at offset '27' for element '/YYYYY[1]/body[1]/XXXXX[1]'.
ParsedDataRegion[InfixSeparator, startOffset = 26, length = 1, scd = #xscd(/schemaElement::XXXXX/type::0/model::sequence/schemaElement::body/type::0/model::sequence)]
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Nov 11, 2013 7:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Note that a default value is not the same as a nil value. The element needs to be nillable, and you need to set up the nil-related properties. In this case you need
- nillable=true
- nilKind='nilLiteralValue'
- NilValue='NULL'
- nilValueDelimiterPolicy='none'
_________________
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
View user's profile Send private message
digoshc
PostPosted: Mon Nov 11, 2013 4:00 pm    Post subject: Reply with quote

Apprentice

Joined: 11 Jul 2013
Posts: 25

Yeah, I was looking for the Nilvalue. It worked. Thank you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Define a default value for a nil value in DFDL Schema
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.