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 » CSV to XML Convertion Error

Post new topic  Reply to topic
 CSV to XML Convertion Error « View previous topic :: View next topic » 
Author Message
MB Developer
PostPosted: Wed Aug 13, 2014 5:03 am    Post subject: CSV to XML Convertion Error Reply with quote

Disciple

Joined: 03 Feb 2014
Posts: 179

Hi Experts,
Greetings,

I want convert CSV data to XML data.

MQ Input Node --> Compute Node --> MQ Output Node

MQ Input Node:
------------------

1. Queue Name
2. Input Message parsing --> Message Domain --> DFDL for ....
3. Message brows (already created a library brows that one) name is --> {}:CSV_TO_CSV
4. Validation --> validate --> Content and Value

MQ Output Node :
----------------
1. Queue Name


MY CSV File is :
-------------------

Name,Number,Salary
BALAJI ,509,13000
Trinath ,101,15000
Mahesh ,549,18000


------> I already Created a library

Compute Node ESQL code is:
-----------------------------------



Quote:
CREATE COMPUTE MODULE CSV_To_XML_EMP_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();

DECLARE inputRefEMP REFERENCE TO InputRoot.DFDL.CSV_TO_CSV.record;

DECLARE i INT 1;

WHILE LASTMOVE (inputRefEMP) DO

SET OutputRoot.XMLNSC.Employees.Emp[i].Name = inputRefEMP.Name;
SET OutputRoot.XMLNSC.Employees.Emp[i].Number = inputRefEMP.Number;
SET OutputRoot.XMLNSC.Employees.Emp[i].Salary = inputRefEMP.Salary;

MOVE inputRefEMP NEXTSIBLING;

SET i = i + 1;

END WHILE;

RETURN TRUE;
END;



After deployed bar file when put CSV message into Input Queue but any data will not come to Output Queue..........


In Event Viewer Error message is :





Quote:
( My.default ) The DFDL parser signalled that an error occurred when processing a DFDL schema.
The message from the DFDL parser is:
'CTDP3108E: When parsing, the IBM DFDL processor does not support an empty or missing element with a default value. '

A DFDL schema error occurred during the parsing of a DFDL message.

Review and resolve the problems indicated in the message from the DFDL parser.



In Trace node error is : (0x03000000:NameValue):Text = 'CTDP3108E: When parsing, the IBM DFDL processor does not support an empty or missing element with a default value. ' (CHARACTER)


please give solution for this problem ..

Thanks in Advance
_________________
Thanks....
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 13, 2014 5:15 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Did you skip the 1st line or at least treat it differently?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Aug 13, 2014 5:26 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
Did you skip the 1st line or at least treat it differently?


Why would that affect the parsing of the input message?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 13, 2014 5:30 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqjeff wrote:
fjb_saper wrote:
Did you skip the 1st line or at least treat it differently?


Why would that affect the parsing of the input message?

Because "Number" and "Salary" are not numeric?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Aug 13, 2014 5:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
mqjeff wrote:
fjb_saper wrote:
Did you skip the 1st line or at least treat it differently?


Why would that affect the parsing of the input message?

Because "Number" and "Salary" are not numeric?


And yet neither of them are empty nor missing
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Aug 13, 2014 5:36 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You should not be debugging your DFDL model by deploying it. The DFDL 'Test parse' feature allows you to debug the model in the toolkit. Is there some reason why you are not doing that?

The problem is that you have a field ( probably lots of fields ) with minOccurs=1, and a default value. And when the data is parsed, the field is empty - which means 'missing' according to DFDL rules. IBM DFDL does not (yet) apply default values to missing fields, so it does not use the default value in the xsd. Instead it issues an error.

The fix is simple - remove the default value, or else set minOccurs=0 on the field. Note that if the field is empty then it will not appear in the message tree. That should not be a problem, but you should test that scenario to make sure that the flow behaves correctly when optional fields are empty/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
View user's profile Send private message
emiddleware
PostPosted: Mon Dec 08, 2014 2:40 am    Post subject: CSV to XML Convertion Error Reply with quote

Centurion

Joined: 03 Apr 2006
Posts: 120

Well said.
Thanks for the information explained about the minOccurs part for the element.
_________________
Best Regards,
E-MiddleWare
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CSV to XML Convertion Error
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.