XML parsing using XML_Plugin

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ketanshah123
Participant
Posts: 88
Joined: Wed Apr 05, 2006 1:04 am

XML parsing using XML_Plugin

Post by ketanshah123 »

Hi All
Structure for XML parsing in my job is as folows


MQ plugin----->XML i/p plugin------>transformer------>filter------>multiple xml i/p pugin


I am getting XML over MQ then I have to parse the XML. This XML structure contains an attribute named type on the root element. In above job structure in trnasformer hv to check for valid type and accoridng to type hv to pass data on different stream again using the filter plugin and again have to extract data using xml plugin according to type.
(this is because for different type of xml there is different attributes will be der so derivation for each column will be different for different xml).

in above structure i want to pass whole xml and type attribute to trnasfomer so how can i do that .... wht will be the xpath/derivation for the same in XML pluign before transformer ?or any other way to do this ?
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Sounds like a job for DataStage TX which turns one type of complex transaction to another. DataStage, if it reads it as XML, will try and flatten which might not be what you want.
ketanshah123
Participant
Posts: 88
Joined: Wed Apr 05, 2006 1:04 am

Post by ketanshah123 »

it is a parallel job actually we are supposed to get some xml msg over mq and are of two type say a and b which we need to find .. and according to type we have to process (different processing for diff. type) .... first i hve to parse it to chk any parsing error then i have sperate data according to type and then again read acceording to type to flatten tht xml.so m bit confused as i hv to parse it ofr parsing error n also hv to extract type from it.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

English is my first language and even I struggled to make sense of that. Please use professional standards of language on DSXchange.

Have you considered doing the parse check in one job and the actual processing in another? I think you'll find such a modular approach easier to understand and to maintain.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: XML parsing using XML_Plugin

Post by chulett »

:? As noted, it is very hard to understand what exactly you are trying to do and what your problem is. However...
ketanshah123 wrote:in above structure i want to pass whole xml and type attribute to trnasfomer so how can i do that .... wht will be the xpath/derivation for the same in XML pluign before transformer ?or any other way to do this ?
If I understand correctly, try using just a forward slash "/" as the XPath Expression when you want to pass XML thru an XML stage undisturbed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply