<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mapping unmatched request and response depending on document order in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Mapping-unmatched-request-and-response-depending-on-document/m-p/2243605#M30036</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt; 
&lt;P&gt;I need help with a task where i need to map requests an responses within one xml-file, where those are not correlated except for the ordering within the document.&lt;/P&gt; 
&lt;P&gt;What shall be the result is a csv-file, containing the request and all the elements of each response in a sequence&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;here is schematic what the xml looks like:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;SomeXML&amp;gt;
	&amp;lt;Request&amp;gt;
		&amp;lt;attribute1&amp;gt;ABC&amp;lt;/attribute1&amp;gt;
		&amp;lt;attribute2&amp;gt;DEF&amp;lt;/attribute2&amp;gt;
	&amp;lt;/Request&amp;gt;
	&amp;lt;Response&amp;gt;
		&amp;lt;Solution&amp;gt;
			&amp;lt;Segment&amp;gt;
				&amp;lt;attribute10&amp;gt;LMN&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;OPQ&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
			&amp;lt;Segment&amp;gt;
				&amp;lt;attribute10&amp;gt;123&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;456&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
		&amp;lt;/Solution&amp;gt;
		&amp;lt;Solution&amp;gt;
				&amp;lt;attribute10&amp;gt;xxx&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;yyy&amp;lt;/attribute11&amp;gt;
		&amp;lt;/Solution&amp;gt;
	&amp;lt;/Response&amp;gt;
&amp;lt;/SomeXML&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;So each request does have one response, but not referencing the request.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Within each respoonse there can be several solutions containing one or more segments.&lt;/P&gt; 
&lt;P&gt;My idea so far is to "enhance" the xml into something like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;SomeXML&amp;gt;
	&amp;lt;Request id="req1"&amp;gt;
		&amp;lt;attribute1&amp;gt;ABC&amp;lt;/attribute1&amp;gt;
		&amp;lt;attribute2&amp;gt;DEF&amp;lt;/attribute2&amp;gt;
	&amp;lt;/Request&amp;gt;
	&amp;lt;Response reqid="req1"&amp;gt;
		&amp;lt;Solution id="sol1"&amp;gt;
			&amp;lt;Segment sortorder="0"&amp;gt;
				&amp;lt;attribute10&amp;gt;LMN&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;OPQ&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
			&amp;lt;Segment sortorder="1"&amp;gt;
				&amp;lt;attribute10&amp;gt;123&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;456&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
		&amp;lt;/Solution&amp;gt;
		&amp;lt;Solution id="sol2"&amp;gt;
			&amp;lt;Segment sortorder="0"&amp;gt;		
				&amp;lt;attribute10&amp;gt;xxx&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;yyy&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
		&amp;lt;/Solution&amp;gt;
	&amp;lt;/Response&amp;gt;
&amp;lt;/SomeXML&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;In particular adding an id-attribute for each request and storing this same id-attribute wihtin the corresponding response as they are unmatched.&lt;/P&gt; 
&lt;P&gt;Plus also adding an id-attribute for each solution and a sortorder to each segment.&lt;/P&gt; 
&lt;P&gt;I am able to convert this structure into the desired csv-format. But I have no clue how to do the "enhancement" of the xml.&lt;/P&gt; 
&lt;P&gt;Unfortunately it is impossible to get such an "enhanced" xml from the sender of the xml-file.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Does anyone have a hint (or maybe even a solution) how to solve this "enhancement"?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks in advance,&lt;/P&gt; 
&lt;P&gt;Stephan&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 16:53:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-13T16:53:25Z</dc:date>
    <item>
      <title>Mapping unmatched request and response depending on document order</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-unmatched-request-and-response-depending-on-document/m-p/2243605#M30036</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt; 
&lt;P&gt;I need help with a task where i need to map requests an responses within one xml-file, where those are not correlated except for the ordering within the document.&lt;/P&gt; 
&lt;P&gt;What shall be the result is a csv-file, containing the request and all the elements of each response in a sequence&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;here is schematic what the xml looks like:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;SomeXML&amp;gt;
	&amp;lt;Request&amp;gt;
		&amp;lt;attribute1&amp;gt;ABC&amp;lt;/attribute1&amp;gt;
		&amp;lt;attribute2&amp;gt;DEF&amp;lt;/attribute2&amp;gt;
	&amp;lt;/Request&amp;gt;
	&amp;lt;Response&amp;gt;
		&amp;lt;Solution&amp;gt;
			&amp;lt;Segment&amp;gt;
				&amp;lt;attribute10&amp;gt;LMN&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;OPQ&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
			&amp;lt;Segment&amp;gt;
				&amp;lt;attribute10&amp;gt;123&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;456&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
		&amp;lt;/Solution&amp;gt;
		&amp;lt;Solution&amp;gt;
				&amp;lt;attribute10&amp;gt;xxx&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;yyy&amp;lt;/attribute11&amp;gt;
		&amp;lt;/Solution&amp;gt;
	&amp;lt;/Response&amp;gt;
&amp;lt;/SomeXML&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;So each request does have one response, but not referencing the request.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Within each respoonse there can be several solutions containing one or more segments.&lt;/P&gt; 
&lt;P&gt;My idea so far is to "enhance" the xml into something like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;SomeXML&amp;gt;
	&amp;lt;Request id="req1"&amp;gt;
		&amp;lt;attribute1&amp;gt;ABC&amp;lt;/attribute1&amp;gt;
		&amp;lt;attribute2&amp;gt;DEF&amp;lt;/attribute2&amp;gt;
	&amp;lt;/Request&amp;gt;
	&amp;lt;Response reqid="req1"&amp;gt;
		&amp;lt;Solution id="sol1"&amp;gt;
			&amp;lt;Segment sortorder="0"&amp;gt;
				&amp;lt;attribute10&amp;gt;LMN&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;OPQ&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
			&amp;lt;Segment sortorder="1"&amp;gt;
				&amp;lt;attribute10&amp;gt;123&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;456&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
		&amp;lt;/Solution&amp;gt;
		&amp;lt;Solution id="sol2"&amp;gt;
			&amp;lt;Segment sortorder="0"&amp;gt;		
				&amp;lt;attribute10&amp;gt;xxx&amp;lt;/attribute10&amp;gt;
				&amp;lt;attribute11&amp;gt;yyy&amp;lt;/attribute11&amp;gt;
			&amp;lt;/Segment&amp;gt;
		&amp;lt;/Solution&amp;gt;
	&amp;lt;/Response&amp;gt;
&amp;lt;/SomeXML&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;In particular adding an id-attribute for each request and storing this same id-attribute wihtin the corresponding response as they are unmatched.&lt;/P&gt; 
&lt;P&gt;Plus also adding an id-attribute for each solution and a sortorder to each segment.&lt;/P&gt; 
&lt;P&gt;I am able to convert this structure into the desired csv-format. But I have no clue how to do the "enhancement" of the xml.&lt;/P&gt; 
&lt;P&gt;Unfortunately it is impossible to get such an "enhanced" xml from the sender of the xml-file.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Does anyone have a hint (or maybe even a solution) how to solve this "enhancement"?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks in advance,&lt;/P&gt; 
&lt;P&gt;Stephan&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-unmatched-request-and-response-depending-on-document/m-p/2243605#M30036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-13T16:53:25Z</dc:date>
    </item>
  </channel>
</rss>

