Page 1 of 1

How to filter XML records

Posted: Mon Apr 07, 2014 6:24 pm
by rajudx
As per the requirement need to read one of the XML file and separate same XML records into another file based on lookup file.

Input
<Mid> 230 </Mid>
<Memname>Frank</Memname>
<Memaddr>123 Ave Raod</Memaddr>
<Memphone>234908789 </Memphone>

<Mid> 130 </Mid>
<Memname>James</Memname>
<Memaddr>6780 Old Traf Road</Memaddr>
<Memphone>567123490</Memphone>

<Mid> 330 </Mid>
<Memname>Tawan</Memname>
<Memaddr>789 Dogules Road</Memaddr>
<Memphone>3458902567 </Memphone>

<Mid> 430 </Mid>
<Memname></Memname>
<Memaddr>4560 North Ave Road</Memaddr>
<Memphone>3412345690 </Memphone>

Lookup File->MID (330,230)

Out put .xml

<Mid> 330 </Mid>
<Memname>Tawan</Memname>
<Memaddr>789 Dogules Road</Memaddr>
<Memphone>3458902567 </Memphone>

<Mid> 230 </Mid>
<Memname>Frank</Memname>
<Memaddr>123 Ave Raod</Memaddr>
<Memphone>234908789 </Memphone>

Right now XML file reading through External source stage->XML input file-Dataset.

Please let me know how to filter XML records based on lookup value and create XML file same format.

Posted: Mon Apr 07, 2014 7:54 pm
by ray.wurlod
What have you tried?

We're really here to help you to develop your skills, rather than to provide solutions. (Some of us are in business doing the latter, but that doesn't count in this discussion.)

So please post any analysis you may have done of the problem (apart from "ask DSXchage how to do my work") and any solution you may have attempted, together with the result thereof.

Posted: Mon Apr 07, 2014 9:31 pm
by chulett
Take XML out of the picture, it isn't really relevant here. You have a stream of records coming in and a lookup to do and you only want to pass records through to the target where the lookup succeeds. That should help. Then the result can either be written out to a dataset as you show currently or use an XML Output stage to take the flattened row and convert it back to XML.