xml – XSLT Template Looping Records

I am working on a requirement to build a xsl tempalte with a loop a position record to print multiple times depending on a vacant positions numbers availabe in each record. I am completely new to this code and created a draft template to print the records. But I am not able to add the loops into this.

Eg: Current text output: PositionIdentifier,Position Name,Grade Name,Vacant Positions 1365,Data Processing Manager,M,2

Expected text output: PositionIdentifier,Position Name,Grade Name,Vacant Positions 1365,Data Processing Manager,M,Vacant1 1365,Data Processing Manager,M,Vacant2

enter image description here

Request your help to complete this code. Please let me know if you need any further information.

Regards, Murali

XML code below:

    <?xml version = '1.0' encoding = 'utf-8'?>
<!--Generated by Oracle BI Publisher -Dataengine, datamodel:_Custom_Human_Capital_Management_Payroll_Data_Models_STL_I_EPM_107_B___Vacant_Positions_Demographics_DM_xdm -->
<DATA_DS><P_DATE>2022-04-19T00:00:00.000+00:00</P_DATE>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1541</POSITIONID><POSITION_NAME>Test Benefits Clerk</POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>1</FILLED_FTE><VACANT_POSITIONS>1</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>1541 Benefits Clerk</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1122</POSITIONID><POSITION_NAME>Test Clerk Typist                  </POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>1</FILLED_FTE><VACANT_POSITIONS>2</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>1122 Clerk Typist</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1513</POSITIONID><POSITION_NAME>Test Human Resources Specialist I  </POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>2</FILLED_FTE><VACANT_POSITIONS>1</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>1513 Human Resources Specialist I</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1514</POSITIONID><POSITION_NAME>Test Human Resources Specialist II </POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>1</FILLED_FTE><VACANT_POSITIONS>1</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>1514 Human Resources Specialist II</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1332</POSITIONID><POSITION_NAME>Test Computer Programmer II</POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>1</FILLED_FTE><VACANT_POSITIONS>1</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>1332 Computer Programmer II</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1352</POSITIONID><POSITION_NAME>Test Systems Project Leader        </POSITION_NAME><GRADE_NAME>M</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>3</FILLED_FTE><VACANT_POSITIONS>2</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>1352 Systems Project Leader</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1371</POSITIONID><POSITION_NAME>Test Technical Support Specialist I</POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>4</FILLED_FTE><VACANT_POSITIONS>2</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>127 Technical Support Specialist I</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>3518</POSITIONID><POSITION_NAME>Test Water Maintenance Technician</POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>7</FILLED_FTE><VACANT_POSITIONS>73</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>WtrDist-DistC-3518 Water Maintenance Technician</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1116</POSITIONID><POSITION_NAME>Test Customer Service Rep I        </POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>1</FILLED_FTE><VACANT_POSITIONS>14</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>Engnr-1116 Customer Service Representative I</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>1142</POSITIONID><POSITION_NAME>Test Account Clerk II              </POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>3</FILLED_FTE><VACANT_POSITIONS>2</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>Account Clerk</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>4241</POSITIONID><POSITION_NAME>Test Civil Engineer I</POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>2</FILLED_FTE><VACANT_POSITIONS>1</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>WtrDist-Engnr-4241 Civil Engineer I</NAME>
</G_1>
<G_1>
<FISCALYEAR>FY22</FISCALYEAR><POSITIONID>3517</POSITIONID><POSITION_NAME>Test Water Maintenance Foreman</POSITION_NAME><GRADE_NAME>G</GRADE_NAME><PAYPERIOD_END_DATE>04/23/2022</PAYPERIOD_END_DATE><PAY_PERIOD>22</PAY_PERIOD><MONTHS>APR</MONTHS><NO_OF_PAYS>26</NO_OF_PAYS><FILLED_FTE>2</FILLED_FTE><VACANT_POSITIONS>20</VACANT_POSITIONS><EMPLOYEE_ID>Vacant</EMPLOYEE_ID><NAME>WtrDist-Mtr Tap-3517 Water Maintenance Foreman</NAME>
</G_1>
</DATA_DS>

Tried to post the Sample XSL code but getting error while posting here. The sample output already shared on the top of the summary.

Please find the XSL code: XSL temp New link

Leave a Comment