Home > OS >  I have more than one XML file, need to compare according to the key to the same field to replace the
I have more than one XML file, need to compare according to the key to the same field to replace the

Time:10-05

Requirements:

1, there is a whole XML files and multiple small XML documents;
2, the overall XML file is given priority to, small XML file is complementary;
3, through open small XML file one by one by keyword search, find the overall XML file corresponding keywords, and then replace the other field values
Example:
A certain period of middle small XML file
- & lt; Card>


- & lt; Account1 & gt;

89860040191702161780 & lt;/ICCID>

460002908135092 & lt;/IMSI>

8 ed46549bbd0583dd271d1d09f62201c & lt;/KI>

BC1D09C3347FCE42DAC6479455C197FF & lt;/OPC>

1234 & lt;/PIN>

09158921 & lt;/PUK>



13570746236 & lt;/MSISDN>





The whole XML file, a middle segment:
- & lt; Card>


- & lt; Account1 & gt;

89860040191702161780 & lt;/ICCID>

460002908135093 & lt;/IMSI>

207 ef2ef1a5ccc64b56ab34caa9ce840 & lt;/KI>

0 ac57b4ad190089da8af29ab4cb3eb5a & lt;/OPC>

1234 & lt;/PIN>

54556972 & lt;/PUK>



13702493275 & lt;/MSISDN>





The key field is the same, namely & lt; ICCID> 89860040191702161780 & lt;/ICCID> Is the same, based on this, to replace the other fields content values.

The full XML capture is as follows:
<? The XML version="1.0"?>

- & lt; Output_File & gt;


- & lt; Batch_Info & gt;




CMCC

GuangDong


GZ



Gemalto







- & lt; Data_Format & gt;



1














- & lt; Data>


- & lt; Card>


- & lt; Account1 & gt;

89860040191702161780 & lt;/ICCID>

460002908135092 & lt;/IMSI>

8 ed46549bbd0583dd271d1d09f62201c & lt;/KI>

BC1D09C3347FCE42DAC6479455C197FF & lt;/OPC>

1234 & lt;/PIN>

09158921 & lt;/PUK>



13570746236 & lt;/MSISDN>






- & lt; Card>


- & lt; Account1 & gt;

89860040191702161781 & lt;/ICCID>

460002908135093 & lt;/IMSI>

207 ef2ef1a5ccc64b56ab34caa9ce840 & lt;/KI>

0 ac57b4ad190089da8af29ab4cb3eb5a & lt;/OPC>

1234 & lt;/PIN>

54556972 & lt;/PUK>

  • Related