我完全被困住了。我正在尝试使用 XLST 查找/替换部分 xml 输出文件。我真的连起点都没有。我尝试使用 Altova DiffDog 来自动生成我的 xlst,因为我对如何自己编写并没有牢牢把握。
这是我当前的 xml 输出文件:
<?xml version='1.0' encoding='UTF-8'?>
<BB:Report_Data xmlns:BB="urn:com.playdate.report/Report-Outbound">
<BB:Report_Entry>
<BB:leaveBalanceTotal.employeeId>1234567</BB:leaveBalanceTotal.employeeId>
<BB:leaveBalanceTotal.bmbId>9280136270</BB:leaveBalanceTotal.bmbId>
<BB:All_Eligible_Time_Off_Plans_for_Worker>
<BB:leaveBalanceTotal.leaveCodeId>1010</BB:leaveBalanceTotal.leaveCodeId>
<BB:leaveBalanceTotal.balanceAmount>0</BB:leaveBalanceTotal.balanceAmount>
<BB:leaveBalanceTotal.effectiveDate>2012-07-05</BB:leaveBalanceTotal.effectiveDate>
<BB:leaveBalanceTotal.lastPayEndDate>2012-07-05</BB:leaveBalanceTotal.lastPayEndDate>
</BB:All_Eligible_Time_Off_Plans_for_Worker>
<BB:All_Eligible_Time_Off_Plans_for_Worker>
<BB:leaveBalanceTotal.leaveCodeId>1014</BB:leaveBalanceTotal.leaveCodeId>
<BB:leaveBalanceTotal.balanceAmount>96</BB:leaveBalanceTotal.balanceAmount>
<BB:leaveBalanceTotal.effectiveDate>2012-07-05</BB:leaveBalanceTotal.effectiveDate>
<BB:leaveBalanceTotal.lastPayEndDate>2012-07-05</BB:leaveBalanceTotal.lastPayEndDate>
</BB:All_Eligible_Time_Off_Plans_for_Worker>
<BB:leaveBalanceTotal.totalDaysService>1459</BB:leaveBalanceTotal.totalDaysService>
</BB:Report_Entry>
</BB:Report_Data>
这就是我需要它的样子:
<?xml version='1.0' encoding='UTF-8'?>
<BB:Report_Data xmlns:BB="urn:com.playdate.report/Report-Outbound">
<leaveBalanceTotal>
<leaveBalanceTotal.employeeId>1234567</leaveBalanceTotal.employeeId>
<leaveBalanceTotal.bmbId>9280136270</leaveBalanceTotal.bmbId>
<leaveBalanceTotal.leaveCodeId>1010</leaveBalanceTotal.leaveCodeId>
<leaveBalanceTotal.balanceAmount>0</leaveBalanceTotal.balanceAmount>
<leaveBalanceTotal.effectiveDate>2012-07-05</leaveBalanceTotal.effectiveDate>
<leaveBalanceTotal.lastPayEndDate>2012-07-05</leaveBalanceTotal.lastPayEndDate>
<leaveBalanceTotal.leaveCodeId>1014</leaveBalanceTotal.leaveCodeId>
<leaveBalanceTotal.balanceAmount>96</leaveBalanceTotal.balanceAmount>
<leaveBalanceTotal.effectiveDate>2012-07-05</leaveBalanceTotal.effectiveDate>
<leaveBalanceTotal.lastPayEndDate>2012-07-05</leaveBalanceTotal.lastPayEndDate>
<leaveBalanceTotal.totalDaysService>1459</leaveBalanceTotal.totalDaysService>
</leaveBalanceTotal>
</BB:Report_Data>
本质上,我正在尝试删除以下所有出现的情况:
- BB:All_Eligible_Time_Off_Plans_for_Worker
- /BB:All_Eligible_Time_Off_Plans_for_Worker
- BB:
我需要用 leaveBalanceTotal 替换 Report_Entry。
任何帮助,将不胜感激!