Page 1 of 1

XML parsing using XML_Plugin

Posted: Mon Oct 22, 2007 11:52 pm
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 ?

Posted: Tue Oct 23, 2007 2:35 am
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.

Posted: Tue Oct 23, 2007 2:44 am
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.

Posted: Tue Oct 23, 2007 4:39 am
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.

Re: XML parsing using XML_Plugin

Posted: Tue Oct 23, 2007 6:27 am
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.