[resolved] How to loop an element in tFileInputXML
Hi: I am trying to map an xml document to table columns using tFileinputXML but stuck how to loop through elements that can be present more than once. E.g see the xml data below, not only I want to loop through all the elements, but I also would like to create a Many to One relationship on the basis of looped element to the relational database. Any help will be appreciated.
<entry dataset="Swiss-Prot" created="1986-07-21" modified="2009-09-01" version="151">
<accession>P00533</accession>
<accession>O00688</accession>
<accession>O00732</accession>
<accession>P06268</accession>
<accession>Q14225</accession>
<accession>Q68GS5</accession>
<accession>Q92795</accession>
<accession>Q9BZS2</accession>
<accession>Q9GZX1</accession>
<accession>Q9H2C9</accession>
<accession>Q9H3C9</accession>
<accession>Q9UMD7</accession>
<accession>Q9UMD8</accession>
<accession>Q9UMG5</accession>
<name>EGFR_HUMAN</name>
</entry>
Thanks,
Rashid.
Hello You can extract the id,name and employee from xml file, then generate two table on tMap. see my screenshots.
Best regards
shong
Hi Shong,
My input xml file as follows. And I have given absolute Xpath : /model-response-list/model-responses/model/attribute but I am getting all attribute information in single colum. Could you please help us and I am unable to see your old screen prints.
<model-response-list xmlns="" throttle="1000" total-models="33328">
<model-responses>
<model mh="0x65a000">
<attribute id="0x1006e">alpcissapp922c</attribute>
<attribute id="0x10030"/>
<attribute id="0x23000e">IP Device</attribute>
<attribute id="0x12d7f">3.34.235.67</attribute>
<attribute id="0x10023" error="NoSuchAttribute"/>
<attribute id="0x10032"/>
</model>
</model-responses>
</model-response-list>
I want to read this XML file using tFileInputMSXML as two Schemas as 1- Header(/AllianceInventory6/Invoice/(Vendor,InvoiceNumber,InvoiceDate..)) and Data(/AllianceInventory6/Invoice/ProductListing/Product/@(UPC,QuantityAdjusted..))
but it is hard to insert for X-path loop for both the schema as the Second Schema is within Invoice.Please help me how to read the file using tFileInputMSXML.