Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Rajender
Creator
Creator

unable to hide tags without information in Talend data mapper

I am new to talend. I have generated Multi and Nested loop complex XML using Talend Data Mapper. I am able to display all tags with or without information. 

 

Now I  there is change, we don't want to display child loop without information. For example consider following example.  Parent2 has multiple loops If there is no information in loop1 and loop2 then i don't want to display their child tag.

 

Following setting I have done.

 1. I have unchecked loop properties "Emit loop Instances if Empty".( Added attachment for reference : emit_loop.jpg)

 2. loop and its child tags: Structure elements Occurs Min/Max are set 0:-1.( Added attachment for reference : pic.jpg)

 

<Parent1>

   <Parent2>

        <loop1>

           <value>1</value>

           <value>2</value>

       </loop1>

       <loop2>

          <v1>xyz</v1>

          <v2>xyx</v2>

      </loop2>

  <parent2>

 <parent3>

 .

 .

 .

</parent3>

<parent1>

 

But still Loop1 and 2 child tag is visible. I have done lots of googling but no luck. Please suggest.

 

Thanks you in Advance.

Labels (4)
1 Solution

Accepted Solutions
Rajender
Creator
Creator
Author

Hi Rhall

 

Thanks for your help. 

 

This issue is resolve. Second thmap use for child value using function isPresence by default. I deleted isPresence from child node loop after which my final xml does not have child node. 

I am not much aware of technicality of TDM but it resolve my issue.

View solution in original post

4 Replies
Anonymous
Not applicable

Can you post an example of the actual XML (values replaced if necessary) so that we can see what you mean? The looping element in your example posted is <value>. But you talk about a child tag which <value> does not have. This will help us to work out what your actual problem is and how you can fix

Rajender
Creator
Creator
Author

Hi Rhall

 

Thanks for your help. 

 

This issue is resolve. Second thmap use for child value using function isPresence by default. I deleted isPresence from child node loop after which my final xml does not have child node. 

I am not much aware of technicality of TDM but it resolve my issue.

Anonymous
Not applicable

Glad you have it resolved. I wanted an example of your XML so that I could actually try it out. The tHMap is one of those components where I need to actually try something out rather than being able to do it in my head 🙂

Rajender
Creator
Creator
Author

Hi Rhall

 

Please refer following XML. Actual XML I cann't  share, So I have created following similar XML.

 

<Message>
<B-king>
<Sourceid>11111</Sourceid>
<TargetID/>
<BoNumber>0017650</BoNumber>
<BStatus>1</BStatus>
<CAStatus>0</CAStatus>
<BLine>
<Sourceid>22222</Sourceid>
<TargetID/>
<ModelType>Cars</ModelType>
<ModelName>i10</ModelName>
<PrimaryCode>3</PrimaryCode>
<SecondaryCode>9</SecondaryCode>
<Quantity>1</Quantity>
<Note/>
</BLine>
<Route>
<SourceID>765991</SourceID>
<TargetID/>
<SequenceNumber>1</SequenceNumber>
<CLine>
<CLineID>33211</CLineID>
<LineID/>
<Status>02</Status>
</CLine>
<CLine>
<CLineID>645332</CLineID>
<LineID/>
<Status>02</Status>
</CLine>
</Route>
<Line>
<SourceID>003</SourceID>
<TargetID/>
<Statu>99</Statu>
<ID/>
<L>12.3</L>
<W>2.5</W>
<H>0.83</H>
<Wt>8000</Wt>
<Remark/>
<Charge>
<base>12</base>
<ratio>.2</ratio>
</Charge>
<CLink>
<LineID>645332</LineID>
<Quantity>1</Quantity>
</CLink>
</Line>
</B-king>
</Message>