AnsweredAssumed Answered

Filter XML Profile based on inputs

Question asked by piyush.e.singh on Jun 21, 2017
Latest reply on Jun 21, 2017 by Sjaak Overgaauw

I have an requirement of filtering XML profile based on date. Is it possible to filter it out directly from XML and write it to Flat file or first I need it to convert it to flat file. Please advice what could be the possible steps I need to take to come up with this. I tried for cross ref but it takes static value only. 

 

If the input is : 2017-02-22

 

Output should be:

O/P should be 

1*XYZ*ASD*2017-02-22*1*4050*549*4034

 

2*ABC*FGH*2017-02-22*15*3050*349*3034

 

 

XML file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Employees>
<Employee>
<ID>1</ID>
<FirstName>XYZ</FirstName>
<LastName>ASD</LastName>
<Events>
<Event>
<EffectiveDate>2017-02-22</EffectiveDate>
<Percentage>1</Percentage>
</Event>
<Event>
<EffectiveDate>2016-02-22</EffectiveDate>
<Percentage>10</Percentage>
</Event>
<Event>
<EffectiveDate>2015-02-22</EffectiveDate>
<Percentage>7</Percentage>
</Event>
</Events>
<PayComponent>
<BaseSalary>4050</BaseSalary>
<HRA>549</HRA>
<VariablePay>4034</VariablePay>
</PayComponent>
</Employee>
<Employee>
<ID>2</ID>
<FirstName>ABC</FirstName>
<LastName>FGH</LastName>
<Events>
<Event>
<EffectiveDate>2017-02-22</EffectiveDate>
<Percentage>15</Percentage>
</Event>
<Event>
<EffectiveDate>2016-02-22</EffectiveDate>
<Percentage>20</Percentage>
</Event>
</Events>
<PayComponent>
<BaseSalary>3050</BaseSalary>
<HRA>349</HRA>
<VariablePay>3034</VariablePay>
</PayComponent>
</Employee>
</Employees>

Outcomes