Hi,
I am using a MQ Connector stage to pull XML messages from MQ.
Each XML File is present as a single message in MQ. Now I want to read this through MQ COnnector and then read it as a XML File format. How can I do this.
Currently, when I read messages, it gives me everything in a single string , rather than in XML file structure..
MQ Connector Stage to Process XML Files
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 76
- Joined: Wed Jan 06, 2016 9:40 am
- Location: Bangalore
MQ Connector Stage to Process XML Files
Thanks
Naren Babu Ch
Naren Babu Ch
-
- Premium Member
- Posts: 76
- Joined: Wed Jan 06, 2016 9:40 am
- Location: Bangalore
Hi chulett,
thank you for solution. but once I read XML file as a string from MQ Connector and use XML Output stage or XML input stage to read this string, how can I make sure metadata in XML parsing stage and MQ Connector stage are same ?
If I read file as a single string, then MQ connector will have a single column. where as the immediate XML Parsing stage , I have to add multiple columns as per the XML file. How is this possible ?
thank you for solution. but once I read XML file as a string from MQ Connector and use XML Output stage or XML input stage to read this string, how can I make sure metadata in XML parsing stage and MQ Connector stage are same ?
If I read file as a single string, then MQ connector will have a single column. where as the immediate XML Parsing stage , I have to add multiple columns as per the XML file. How is this possible ?
Thanks
Naren Babu Ch
Naren Babu Ch
Guessing you've not worked with XML before? High level:
You need to generate the metadata from either a sample of the file itself or from an "xsd" you received from the source. That will generate the columns and "XPath Expressions" needed to parse the XML and you can then import that into your stage so it knows what to do.
XML Input stage, btw. XML Output is for creating XML. Or there's the new XML stage but it will be a little daunting for someone new to the XML experience.
You need to generate the metadata from either a sample of the file itself or from an "xsd" you received from the source. That will generate the columns and "XPath Expressions" needed to parse the XML and you can then import that into your stage so it knows what to do.
XML Input stage, btw. XML Output is for creating XML. Or there's the new XML stage but it will be a little daunting for someone new to the XML experience.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 76
- Joined: Wed Jan 06, 2016 9:40 am
- Location: Bangalore
The MQ Connector just delivers messages --- and at best, a single column....just a big chunk of text. Deliver that to your xmlInput Stage or the Hierarchical Stage as a single column... (Craig is correct --- start with the xmlInput Stage if you have never done xml before).
And LONG before you try to combine them as outlined above, work with them separately..... (a) Get ONE messages read from the message queue and into a sequential file using the Sequential Stage. One column on the input link, and use NONE and NONE for the quote character and the delimiter. Make sure you get a single nice clean row of data, with a whole document that represents your original whole message. (b). Then learn how to parse THAT sequential file with the xmlInput Stage, parsing it accordingly after importing the metadata for the xml document file you just produced. Read hundreds of other posts to this forum....look thru the doc. There are lots of places to get resources on how to make that happen. (c) combine the two.
Ernie
And LONG before you try to combine them as outlined above, work with them separately..... (a) Get ONE messages read from the message queue and into a sequential file using the Sequential Stage. One column on the input link, and use NONE and NONE for the quote character and the delimiter. Make sure you get a single nice clean row of data, with a whole document that represents your original whole message. (b). Then learn how to parse THAT sequential file with the xmlInput Stage, parsing it accordingly after importing the metadata for the xml document file you just produced. Read hundreds of other posts to this forum....look thru the doc. There are lots of places to get resources on how to make that happen. (c) combine the two.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Premium Member
- Posts: 76
- Joined: Wed Jan 06, 2016 9:40 am
- Location: Bangalore