Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table with some data in it, for example:
ID Name Type
| 1 | ProductA | TypeA |
| 2 | ProductB | TypeA |
| 3 | ProductC | TypeB |
I am willing to get the next XML
<Products> <Product> <ID>1</ID> <Name>ProductA</Name> <Type>TypeA</Type> </Product> <Product> <ID>2</ID> <Name>ProductB</Name> <Type>TypeA</Type> </Product> <Product> <ID>3</ID> <Name>ProductC</Name> <Type>TypeB</Type> </Product>
</Products>
What I am getting is the next
<Products> <Product> <ID>1</ID> <Name>ProductA</Name> <Type>TypeA</Type> </Product> </Products>
My current flow is the next
tMSSqlSp -> tParseRecordSet -> tMap -> tWriteXMLField
First I execute the procedure to get my results, I parse them to fields using the tParseRecordSet, I use a tMap to generate XML out of the parsed results and then I use the tWriteXMLField to try to complete my XML. Products is a group element whereby I have choosen the Product as a loop. I might be misunderstanding how the loop functionality works, as I am only getting the first result as a XML.
We are entitled to Talend ESB version 6.1.1 and have an enterprise license.
For your information, I of course used fictional data as it is company sensitive.
You need to look at this https://help.talend.com/reader/ixBASPZJ7IvqUQVupZwWbg/EFuE5Nul595D24TRwbFnbw
Pay special attention to the "All in One" boolean on your tXMLMap output. This will need to be set to true.
You need to look at this https://help.talend.com/reader/ixBASPZJ7IvqUQVupZwWbg/EFuE5Nul595D24TRwbFnbw
Pay special attention to the "All in One" boolean on your tXMLMap output. This will need to be set to true.
Are you looking for the following output?
Regards,
I already have seen the example and it is not entirely the same though. It already starts from a XML, where I start from a RecordSet. I have the following columns, all on the same level:
From my understanding, as I am only a rookie using Talend, the tMap gets executed for each record in the recordset, which then has to be combined into a new XML by using the tWriteXMLField.
Neither do I have the option "All in One".
It doesn't need to start from an XML....that is just the example. It can start from row data. In fact most people use it that way. Here is a somewhat more complicated tutorial on how to use the tXMLMap. Ignore the Java code as that is for something else, but look for where I explain the tXMLMap settings
https://www.rilhia.com/tutorials/load-xml-files-batches-records
@KennethA,are you looking for this?