Author |
Message
|
MB Developer |
Posted: Wed Aug 13, 2014 5:03 am Post subject: CSV to XML Convertion Error |
|
|
 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 |
|
 |
fjb_saper |
Posted: Wed Aug 13, 2014 5:15 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Wed Aug 13, 2014 5:26 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Wed Aug 13, 2014 5:30 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Wed Aug 13, 2014 5:35 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Wed Aug 13, 2014 5:36 am Post subject: |
|
|
 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 |
|
 |
emiddleware |
Posted: Mon Dec 08, 2014 2:40 am Post subject: CSV to XML Convertion Error |
|
|
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 |
|
 |
|