感谢您及时的回复。我尝试了两个答案。它没有按我的预期工作。请找到下面的输入和预期的输出。提前致谢
Input:
<Billing>
<billSummary>
<billTo>
<accountNumber>130212192 </accountNumber>
<MSISDN>1234567890 </MSISDN>
</billTo>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>ONE_TIME </typeCode>
<amount>100.12 </amount>
<description>ONE_TIME_CHARGE </description>
</charge>
<charge>
<typeCode>ACCESS </typeCode>
<amount>100.12 </amount>
<description>ACCESS_CHARGE </description>
</charge>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>FEATURE </typeCode>
<amount>100.12 </amount>
<description>FEATURE_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS </description>
</deduction>
<charge>
<typeCode>AIRTIME </typeCode>
<amount>100.12 </amount>
<description>AIRTIME_CHARGE </description>
</charge>
<charge>
<typeCode>LONG_DISTANCE </typeCode>
<amount>100.12 </amount>
<description>LONG_DISTANCE_CHARGE </description>
</charge>
<charge>
<typeCode>ROAMING </typeCode>
<amount>100.12 </amount>
<description>ROAMING_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS </description>
</deduction>
</billSummary>
<billSummary>
<billTo>
<accountNumber>130212192 </accountNumber>
<MSISDN>1234567890 </MSISDN>
</billTo>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>ONE_TIME </typeCode>
<amount>100.12 </amount>
<description>ONE_TIME_CHARGE </description>
</charge>
<charge>
<typeCode>ACCESS </typeCode>
<amount>100.12 </amount>
<description>ACCESS_CHARGE</description>
</charge>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>FEATURE </typeCode>
<amount>100.12 </amount>
<description>FEATURE_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS </description>
</deduction>
<charge>
<typeCode>AIRTIME </typeCode>
<amount>100.12 </amount>
<description>AIRTIME_CHARGE </description>
</charge>
<charge>
<typeCode>LONG_DISTANCE </typeCode>
<amount>100.12 </amount>
<description>LONG_DISTANCE_CHARGE </description>
</charge>
<charge>
<typeCode>ROAMING </typeCode>
<amount>100.12 </amount>
<description>ROAMING_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS</description>
</deduction>
</billSummary>
</Billing>
Expected Output:
<Billing>
<billSummary>
<billTo>
<accountNumber>130212192 </accountNumber>
<MSISDN>1234567890 </MSISDN>
</billTo>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>ONE_TIME </typeCode>
<amount>100.12 </amount>
<description>ONE_TIME_CHARGE </description>
</charge>
<charge>
<typeCode>ACCESS </typeCode>
<amount>100.12 </amount>
<description>ACCESS_CHARGE </description>
</charge>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>FEATURE </typeCode>
<amount>100.12 </amount>
<description>FEATURE_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS </description>
</deduction>
<charge>
<typeCode>AIRTIME </typeCode>
<amount>100.12 </amount>
<description>AIRTIME_CHARGE </description>
</charge>
<charge>
<typeCode>LONG_DISTANCE </typeCode>
<amount>100.12 </amount>
<description>LONG_DISTANCE_CHARGE </description>
</charge>
<charge>
<typeCode>ROAMING </typeCode>
<amount>100.12 </amount>
<description>ROAMING_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS </description>
</deduction>
</billSummary>
<billSummary>
<billTo>
<accountNumber>130212192 </accountNumber>
<MSISDN>1234567890 </MSISDN>
</billTo>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>ONE_TIME </typeCode>
<amount>100.12 </amount>
<description>ONE_TIME_CHARGE </description>
</charge>
<charge>
<typeCode>ACCESS </typeCode>
<amount>100.12 </amount>
<description>ACCESS_CHARGE</description>
</charge>
<tax>
<amount>100.12 </amount>
<description>TAXES </description>
</tax>
<charge>
<typeCode>FEATURE </typeCode>
<amount>100.12 </amount>
<description>FEATURE_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS </description>
</deduction>
<charge>
<typeCode>AIRTIME </typeCode>
<amount>100.12 </amount>
<description>AIRTIME_CHARGE </description>
</charge>
<charge>
<typeCode>LONG_DISTANCE </typeCode>
<amount>100.12 </amount>
<description>LONG_DISTANCE_CHARGE </description>
</charge>
<charge>
<typeCode>ROAMING </typeCode>
<amount>100.12 </amount>
<description>ROAMING_CHARGE </description>
</charge>
<deduction>
<amount>100.12 </amount>
<description>ADJUSTMENTS</description>
</deduction>
</billSummary>
</Billing>