Author |
Message
|
Mensch |
Posted: Wed Oct 18, 2006 2:53 am Post subject: XML to CSV conversion |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
Hi
I am trying to convert XML message format in to CSV.
But through ESQL I am not able to access input XML elements as I am not able to see any input elements mapped to output CSV elements.
Input message set physical format is XML
Parser used in input node: MRM
Message Format :XML
Rightnow i am trying to access input XML elements as
SET OutputRoot.MessageName.CSVElement = InputRoot.XML.MessageName.XMLElement
CSVElement should be mapped to XMLElement.but in my code I am able to assign default values but not able to map the XML Elements.
Please help. _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 18, 2006 3:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
This is basic use of the product. Please get some training.
Your first big clue is that MRM is not the same as XML. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Mensch |
Posted: Wed Oct 18, 2006 5:17 am Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
Hi
Thanks a ton for your promt reply..
I managed to map XML elements to CSv elements ..but the problem is I am getting message on the output queue of length zero.
But I have put trace node just before MQoutput node and It shows output CSV elements mapped to input XML elements correctly.
What might be the reason? _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 18, 2006 5:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't know. Actually, I do know. You did something wrong. I don't know *what* you did wrong, though.
Are you getting errors?
Again, this is probably an error with basic use of this product. WMB is complicated, and you should receive training on it. And you shouldn't expect anyone here to give you that training. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Mensch |
Posted: Wed Oct 18, 2006 5:25 am Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
Hi
No ... I am not getting any errors.
Whenever I put any XMl message in to input queue message of length zero is getting written in to output queue.but the trace file put just before outputnode shows elemnts mapped correctly.
Please help _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
Mensch |
Posted: Wed Oct 18, 2006 5:27 am Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
All my other flows are working fine... _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 18, 2006 5:29 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Probably you are telling the flow to output the wrong thing.
The MQOutput node always writes out the Last Child of Root. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Edde |
Posted: Wed Oct 18, 2006 5:50 am Post subject: Re: XML to CSV conversion |
|
|
 Acolyte
Joined: 01 Oct 2006 Posts: 67 Location: Moscow, Russia
|
Mensch wrote: |
Rightnow i am trying to access input XML elements as
SET OutputRoot.MessageName.CSVElement = InputRoot.XML.MessageName.XMLElement
|
Afaik OutputRoot.MessageName does not make sense.
If you want to have CSV on output, use OutputRoot.MRM.CSVElement and don't forget to set MessageSet, MessageType and MessageFormat in OutputRoot.Properties. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Oct 18, 2006 7:03 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
edde is correct. And you should have been able to see that very clearly in the trace node output ( by simply comparing your path to the message tree ). |
|
Back to top |
|
 |
Mensch |
Posted: Wed Oct 18, 2006 8:33 pm Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
Hi
I am able to map XML elements to CSV elements correctly.
Trace node applied just before MQOutputnode gives output as
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'IS_MS_XML'
(0x03000000):MessageType = 'InputXML'
(0x03000000):MessageFormat = 'XML'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2006-10-19 04:18:39.470'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'IN'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d512042524b514d435453202020207bf1364520002a04'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'BRKQM '
(0x03000000):UserIdentifier = '136039 '
(0x03000000):AccountingToken = X'16010515000000e07b3c460068001818494617b0c1020000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 's\mensch\Desktop\rfhutil.exe'
(0x03000000):PutDate = DATE '2006-10-19'
(0x03000000):PutTime = GMTTIME '04:18:39.470'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x03000000):CSV_Element1 = 'abc'
)
But output queue contains message of length zero.
where as I am expecting CSV message in the output queue
Please help _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
vk |
Posted: Wed Oct 18, 2006 9:24 pm Post subject: |
|
|
Partisan
Joined: 20 Sep 2005 Posts: 302 Location: Houston
|
The trace shows
Quote: |
MessageFormat = 'XML' |
You should be setting MessageFormat to CSV and also you need to set MessageDomain to MRM for the OutputRoot Properties.
Can you post the ESQL for your compute node?
Regards,
VK. |
|
Back to top |
|
 |
Mensch |
Posted: Wed Oct 18, 2006 10:44 pm Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
hi
Sorry I pasted wrong trace file.Actual trace output that i am getting is as follows
(0x01000000):Properties = (
(0x03000000):MessageSet = 'IS_OutPutCSV'
(0x03000000):MessageType = 'outputCSV'
(0x03000000):MessageFormat = 'CSV'
..................
And the code is as follows:
After Copying message headers
SET OutputRoot.Properties.MessageFormat = 'CSV';
SET OutputRoot.Properties.MessageType = 'outputCSV'
SET OutputRoot.Properties.MessageSetID = ' Actual ID for the output message set ';
-- elements mapping
SET OutputRoot.outputCSV.CSV_Element1 = InputBody.InputXML.XMLelement1;
Please let me k now if u need any more info
TIA _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
Edde |
Posted: Wed Oct 18, 2006 10:59 pm Post subject: |
|
|
 Acolyte
Joined: 01 Oct 2006 Posts: 67 Location: Moscow, Russia
|
Mensch wrote: |
-- elements mapping
SET OutputRoot.outputCSV.CSV_Element1 = InputBody.InputXML.XMLelement1;
Please let me k now if u need any more info
TIA |
One more time.
Do not use OutputRoot.outputCSV.CSV_Element1.
Use OutputRoot.MRM.CSV_Element1. |
|
Back to top |
|
 |
edarasumanth |
Posted: Fri Oct 20, 2006 2:22 am Post subject: |
|
|
Novice
Joined: 15 Jun 2006 Posts: 21
|
when mapping xml fields to csv. u need to create a message set for the csv. u will be defining the structure of csv in the message definition file. there is no need of creating message definition file for the incoming xml message.
since u'r output is csv i am writing the sample code
SET OutputRoot.Properties.MessageSet='BR40QO0002001';
SET OutputRoot.Properties.MessageFormat='TDS1';
SET OutputRoot.Properties.MessageType='STUDENT';
SET OutputRoot.MRM.STUDENTRECORD.SNO=InputRoot.XML.EMP.ENO;
SET OutputRoot.MRM.STUDENTRECORD.SNAME=InputRoot.XML.EMP.ENAME;
if this is the input message
<EMP><ENO>001</ENO><ENAME>JOHN</ENAME></EMP>
the output will be attaining in the following manner
123,JOHN
u will be specifying the delimiter , in the message definition file properties. |
|
Back to top |
|
 |
|