Posted: Thu Apr 12, 2012 10:00 pm Post subject: not getting null value converting xml to Text1
Newbie
Joined: 10 Apr 2012 Posts: 2
hi there,
i am converting XML msg to Text Delimited file output.
for this am using two message set one is xml and other is Text1.
1)even its xml message set we are selecting Domain as MRM.
so our mapping logic like:
SET OutputRoot.MRM = InputRoot.MRM;
-------------------
in op message set i m selecting
O/p Policy for missing element : useNullValue
then In Local element of nullable elemts:
Logical property : Nillable=true
Physical Property : Encoding Null=NullLiteralValue
Encoding Null Value= ''
in message definition i am having 3 elements in Conversion after ConvertToXXXCode but if remove it from the input message becuase its optional but then in op its not appending delimiter for that.
but if i remove any element in between then its appending ~ for that.
coming op : CD~XXXName~XXXDescription~~token~~ISO~~2001-12-31 ~2001-12-31~GE
Posted: Fri Apr 13, 2012 12:14 am Post subject: Re: not getting null value converting xml to Text1
Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
warrior12 wrote:
-------------------
in op message set i m selecting
O/p Policy for missing element : useNullValue
then In Local element of nullable elemts:
Logical property : Nillable=true
Physical Property : Encoding Null=NullLiteralValue
Encoding Null Value= ''
I may be wrong, but I am under the impression that for TDS messages these are applied for input messages only.
Code:
SET OutputRoot.MRM = InputRoot.MRM;
IF OutputRoot.MRM.SecondLastField IS NULL THEN
SET OutputRoot.MRM.SecondLastField = '';
END IF;
IF OutputRoot.MRM.LastField IS NULL THEN
SET OutputRoot.MRM.LastField = '';
END IF;
1)even its xml message set we are selecting Domain as MRM.
Please do not use the MRM parser for XML data. There is no good reason to do that. XMLNSC is the correct parser for XML data. You can just change your ESQL to
Code:
SET OutputRoot.MRM = InputRoot.XMLNSC.(XMLNSC.Element)*[1];
Quote:
in op message set i m selecting
O/p Policy for missing element : useNullValue
...
Those settings do not control the output of elements that are missing from the message tree. They control how a NULL value gets written out.
Important question: does your message tree contain any NULL values? ( a Trace node will give you the answer ). If not, then those settings will have no effect at all on your output.
I suspect that McueMart is on the right lines here
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