当前位置:   article > 正文

将一个xml文件中的多条数据,均匀存入多个新的xml文件中_ 如何添加进xml

如何添加进xml

将xml文件中的15条数据,平均存入7个新的xml中

xml文件如下:

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <gwl>
  3. <version>20230417084108</version>
  4. <entities>
  5. <entity id="1123831" version="20230414163503">
  6. <name>ALMOND, LINCOLN CARTER</name>
  7. <listId>1021</listId>
  8. <listCode>USP</listCode>
  9. <entityType>03</entityType>
  10. <createdDate>09/02/2004</createdDate>
  11. <lastUpdateDate>04/14/2023</lastUpdateDate>
  12. <source>USP</source>
  13. <OriginalSource>PEP</OriginalSource>
  14. <dobs>
  15. <dob Y="1936">06/16/1936</dob>
  16. </dobs>
  17. <pobs>
  18. <pob>Pawtucket, Rhode Island, United States</pob>
  19. </pobs>
  20. <titles>
  21. <title>FORMER GOVERNOR OF RHODE ISLAND (JANUARY 3, 1995 - JANUARY 7, 2003). DECEASED JANUARY 02, 2023.</title>
  22. </titles>
  23. <sdfs>
  24. <sdf name="OtherInformation">Career: Governor of Rhode Island (January 03, 1995 - January 07, 2003); United State Attorney for the District of Rhode Island (October 09, 1981 - January 20, 1993); United State Attorney for the District of Rhode Island (1969 - 1978).</sdf>
  25. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=d14d930f-7943-4363-b4d0-aa2c59437e1b</sdf>
  26. <sdf name="EffectiveDate">1981</sdf>
  27. <sdf name="EntityLevel">State</sdf>
  28. <sdf name="ExpirationDate">1993</sdf>
  29. <sdf name="Gender">MALE</sdf>
  30. <sdf name="NameSource">Website</sdf>
  31. <sdf name="Org_PID">1706394</sdf>
  32. <sdf name="OriginalID">7031</sdf>
  33. <sdf name="Relationship">Father</sdf>
  34. <sdf name="SubCategory">Former PEP</sdf>
  35. </sdfs>
  36. <addresses>
  37. <address>
  38. <country>US</country>
  39. <countryName>UNITED STATES</countryName>
  40. </address>
  41. </addresses>
  42. </entity>
  43. <entity id="1124766" version="20230414163503">
  44. <name>BAUCUS, MAX SIEBEN</name>
  45. <listId>1021</listId>
  46. <listCode>USP</listCode>
  47. <entityType>03</entityType>
  48. <createdDate>09/02/2004</createdDate>
  49. <lastUpdateDate>04/14/2023</lastUpdateDate>
  50. <source>USP</source>
  51. <OriginalSource>PEP</OriginalSource>
  52. <dobs>
  53. <dob Y="1941">12/11/1941</dob>
  54. </dobs>
  55. <pobs>
  56. <pob>Helena, Montana, United States</pob>
  57. </pobs>
  58. <aliases>
  59. <alias type="Alias">ENKE, MAX SIEBEN</alias>
  60. </aliases>
  61. <titles>
  62. <title>FORMER AMBASSADOR OF THE UNITED STATES TO CHINA (MARCH 20, 2014 - JANUARY 16, 2017).</title>
  63. </titles>
  64. <sdfs>
  65. <sdf name="OtherInformation">Political Party: Democratic. Career: Ambassador Extraordinary and Plenipotentiary of the United States to China, (March 20, 2014 - January 16, 2017); Member of the United States Congress, Senate from Montana (December 15, 1978 - February 06, 2014);</sdf>
  66. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=945fd382-f5b7-42c4-ad1f-a40c4bf0e285</sdf>
  67. <sdf name="EffectiveDate">1978</sdf>
  68. <sdf name="EntityLevel">National</sdf>
  69. <sdf name="ExpirationDate">2014</sdf>
  70. <sdf name="Gender">MALE</sdf>
  71. <sdf name="NameSource">Website</sdf>
  72. <sdf name="Org_PID">548118</sdf>
  73. <sdf name="OriginalID">7542</sdf>
  74. <sdf name="Relationship">Brother</sdf>
  75. <sdf name="SubCategory">Former PEP</sdf>
  76. </sdfs>
  77. <addresses>
  78. <address>
  79. <country>US</country>
  80. <countryName>UNITED STATES</countryName>
  81. <province>WASHINGTON, DC</province>
  82. <postalCode>20515</postalCode>
  83. </address>
  84. <address>
  85. <country>US</country>
  86. <countryName>UNITED STATES</countryName>
  87. <province>WASHINGTON, D.C.</province>
  88. <postalCode>20510</postalCode>
  89. </address>
  90. <address>
  91. <address1>55 ANJIALOU RD</address1>
  92. <city>BEIJING</city>
  93. <country>CN</country>
  94. <countryName>CHINA</countryName>
  95. <postalCode>100600</postalCode>
  96. </address>
  97. </addresses>
  98. </entity>
  99. <entity id="1124842" version="20230414163503">
  100. <name>THOMAS, CRAIG LYLE</name>
  101. <listId>1021</listId>
  102. <listCode>USP</listCode>
  103. <entityType>03</entityType>
  104. <createdDate>09/02/2004</createdDate>
  105. <lastUpdateDate>04/14/2023</lastUpdateDate>
  106. <source>USP</source>
  107. <OriginalSource>PEP</OriginalSource>
  108. <dobs>
  109. <dob Y="1933">02/17/1933</dob>
  110. </dobs>
  111. <pobs>
  112. <pob>Cody, Wyoming, United States</pob>
  113. </pobs>
  114. <titles>
  115. <title>FORMER MEMBER OF THE UNITED STATES CONGRESS (JANUARY 03, 1995 - JUNE 04, 2007). DECEASED JUNE 04, 2007.</title>
  116. </titles>
  117. <sdfs>
  118. <sdf name="OtherInformation">Political Party: Republican. Career: Member of the United States Congress, Senate, Class I (January 03, 1995 - June 04, 2007); Member of the United States Congress, House of Representatives, At-Large (April 27, 1989 - January 03, 1995). Member of the</sdf>
  119. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=4e7b1050-36b5-4b1c-9037-c2349c519d40</sdf>
  120. <sdf name="EffectiveDate">1989</sdf>
  121. <sdf name="EntityLevel">National</sdf>
  122. <sdf name="ExpirationDate">1995</sdf>
  123. <sdf name="Gender">MALE</sdf>
  124. <sdf name="NameSource">Website</sdf>
  125. <sdf name="Org_PID">1817490</sdf>
  126. <sdf name="OriginalID">7629</sdf>
  127. <sdf name="Relationship">Father</sdf>
  128. <sdf name="SubCategory">Former PEP</sdf>
  129. </sdfs>
  130. <addresses>
  131. <address>
  132. <country>US</country>
  133. <countryName>UNITED STATES</countryName>
  134. <province>WASHINGTON D.C.</province>
  135. <postalCode>20510</postalCode>
  136. </address>
  137. <address>
  138. <address1>200 WEST 24TH STREET</address1>
  139. <city>CHEYENNE</city>
  140. <state>WY</state>
  141. <stateName>WYOMING</stateName>
  142. <country>US</country>
  143. <countryName>UNITED STATES</countryName>
  144. <postalCode>82002</postalCode>
  145. </address>
  146. </addresses>
  147. </entity>
  148. <entity id="1125230" version="20230414163051">
  149. <name>PATRIAT, FRANCOIS</name>
  150. <listId>1020</listId>
  151. <listCode>PEP</listCode>
  152. <entityType>03</entityType>
  153. <createdDate>09/02/2004</createdDate>
  154. <lastUpdateDate>04/14/2023</lastUpdateDate>
  155. <source>PEP</source>
  156. <OriginalSource>PEP</OriginalSource>
  157. <dobs>
  158. <dob Y="1943">03/21/1943</dob>
  159. </dobs>
  160. <pobs>
  161. <pob>Semur-en-Auxois, , France</pob>
  162. </pobs>
  163. <titles>
  164. <title>MEMBER OF THE FRENCH PARLIAMENT (OCTOBER 01, 2008 - 2026).</title>
  165. </titles>
  166. <sdfs>
  167. <sdf name="OtherInformation">Political party: La Republique en marche (LREM) (currently known as Renaissance). Career: Member of the Executive Bureau of La Republique en Marche (LREM), The Republic on the Move (currently known as Renaissance), effective from November 18, 2017;</sdf>
  168. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=a4ffd4f3-5c75-440b-aeca-4e3a7d2ef642</sdf>
  169. <sdf name="EffectiveDate">2008</sdf>
  170. <sdf name="EntityLevel">National</sdf>
  171. <sdf name="ExpirationDate">2026</sdf>
  172. <sdf name="Gender">MALE</sdf>
  173. <sdf name="NameSource">Website</sdf>
  174. <sdf name="Org_PID">3759009</sdf>
  175. <sdf name="OriginalID">8117</sdf>
  176. <sdf name="Relationship">Associate</sdf>
  177. <sdf name="SubCategory">Govt Branch Member</sdf>
  178. </sdfs>
  179. <addresses>
  180. <address>
  181. <address1>15, RUE DE VAUGIRARD</address1>
  182. <city>PARIS</city>
  183. <country>FR</country>
  184. <countryName>FRANCE</countryName>
  185. <postalCode>75291</postalCode>
  186. </address>
  187. </addresses>
  188. </entity>
  189. <entity id="1125282" version="20230414163052">
  190. <name>BENOUTIQ, ABDELKRIM</name>
  191. <listId>1020</listId>
  192. <listCode>PEP</listCode>
  193. <entityType>03</entityType>
  194. <createdDate>09/02/2004</createdDate>
  195. <lastUpdateDate>04/14/2023</lastUpdateDate>
  196. <source>PEP</source>
  197. <OriginalSource>PEP</OriginalSource>
  198. <dobs>
  199. <dob Y="1959">08/19/1959</dob>
  200. </dobs>
  201. <pobs>
  202. <pob>Rabat, Rabat-Sale-Kenitra Region, Morocco</pob>
  203. </pobs>
  204. <aliases>
  205. <alias type="Alias">BEN ATIQ, ABDELKRIM</alias>
  206. <alias type="Alias">BENATIQ, ABDELKRIM</alias>
  207. </aliases>
  208. <nativeCharNames>
  209. <nativeCharName charSet="" latinCharName="BEN ATIQ, ABDELKRIM" type="Alias">??? ?????? ?? ????</nativeCharName>
  210. <nativeCharName charSet="" latinCharName="BENATIQ, ABDELKRIM" type="Alias">??? ?????? ??????</nativeCharName>
  211. <nativeCharName charSet="" latinCharName="BENOUTIQ, ABDELKRIM" type="Primary">??? ?????? ??????</nativeCharName>
  212. </nativeCharNames>
  213. <titles>
  214. <title>FORMER MEMBER OF THE POLITICAL BUREAU OF SOCIALIST UNION OF POPULAR FORCES PARTY, MOROCCO, ELECTED JUNE 10, 2017, EFFECTIVE UNTIL APRIL 24, 2022.</title>
  215. </titles>
  216. <sdfs>
  217. <sdf name="OtherInformation">Political Party: Union Socialiste Des Forces Populaires (USFP) Career: Member of the Political Bureau of Union Socialiste Des Forces Populaires (USFP), Socialist Union of Popular Forces Party, elected June 10, 2017, effective until April 24, 2022;</sdf>
  218. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=35f8bcea-6169-4a8f-9715-81de730d1c17</sdf>
  219. <sdf name="EffectiveDate">2000</sdf>
  220. <sdf name="EntityLevel">National</sdf>
  221. <sdf name="ExpirationDate">2001</sdf>
  222. <sdf name="Gender">MALE</sdf>
  223. <sdf name="NameSource">Website</sdf>
  224. <sdf name="OriginalID">8181</sdf>
  225. <sdf name="SubCategory">Former PEP</sdf>
  226. </sdfs>
  227. <addresses>
  228. <address>
  229. <address1>9, AVENUE AL ARAAR</address1>
  230. <city>RABAT</city>
  231. <country>MA</country>
  232. <countryName>MOROCCO</countryName>
  233. <province>RABAT-SALE-KENITRA REGION</province>
  234. </address>
  235. <address>
  236. <address1>AVENUE F.ROOSEVELT</address1>
  237. <city>RABAT</city>
  238. <country>MA</country>
  239. <countryName>MOROCCO</countryName>
  240. <province>RABAT-SALE-KENITRA REGION</province>
  241. </address>
  242. <address>
  243. <address1>NO. 9 ARAR STREET</address1>
  244. <city>RABAT</city>
  245. <country>MA</country>
  246. <countryName>MOROCCO</countryName>
  247. <province>RABAT-SALE-KENITRA REGION</province>
  248. </address>
  249. </addresses>
  250. </entity>
  251. <entity id="1125443" version="20230414163053">
  252. <name>OLLING, SVEND</name>
  253. <listId>1020</listId>
  254. <listCode>PEP</listCode>
  255. <entityType>03</entityType>
  256. <createdDate>09/02/2004</createdDate>
  257. <lastUpdateDate>04/14/2023</lastUpdateDate>
  258. <source>PEP</source>
  259. <OriginalSource>PEP</OriginalSource>
  260. <dobs>
  261. <dob Y="1967">11/09/1967</dob>
  262. </dobs>
  263. <pobs>
  264. <pob>Glostrup, , Denmark</pob>
  265. </pobs>
  266. <titles>
  267. <title>AMBASSADOR OF DENMARK TO SOUTH KOREA, AS OF MARCH 30, 2023.</title>
  268. </titles>
  269. <sdfs>
  270. <sdf name="OtherInformation">Career: Ambassador of Denmark to South Korea, as of March 30, 2023; Ambassador of Denmark to Egypt, as of May 28, 2020, expiration reported March 20, 2023; Non-Resident Ambassador of Denmark to Azerbaijan, effective from March 26, 2017, expiration</sdf>
  271. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=ef160921-f06b-4942-9527-0ee7565467c0</sdf>
  272. <sdf name="EffectiveDate">2023</sdf>
  273. <sdf name="EntityLevel">International</sdf>
  274. <sdf name="Gender">MALE</sdf>
  275. <sdf name="NameSource">Website</sdf>
  276. <sdf name="Org_PID">8698914</sdf>
  277. <sdf name="OriginalID">8384</sdf>
  278. <sdf name="Relationship">Father</sdf>
  279. <sdf name="SubCategory">Diplomat</sdf>
  280. </sdfs>
  281. <addresses>
  282. <address>
  283. <address1>416, HANGANG-DAERO, JUNG-GU</address1>
  284. <city>SEOUL</city>
  285. <country>KR</country>
  286. <countryName>KOREA, REPUBLIC OF</countryName>
  287. <postalCode>04637</postalCode>
  288. </address>
  289. <address>
  290. <address1>TURAN GUENES BULVARI 106</address1>
  291. <city>ANKARA</city>
  292. <country>TR</country>
  293. <countryName>TURKEY</countryName>
  294. <postalCode>06550</postalCode>
  295. </address>
  296. <address>
  297. <address1>ASIATISK PLADS 2</address1>
  298. <city>COPENHAGEN</city>
  299. <country>DK</country>
  300. <countryName>DENMARK</countryName>
  301. <postalCode>1448</postalCode>
  302. </address>
  303. <address>
  304. <address1>NORTH AVENUE</address1>
  305. <city>DHAKA</city>
  306. <country>BD</country>
  307. <countryName>BANGLADESH</countryName>
  308. <postalCode>1212</postalCode>
  309. </address>
  310. <address>
  311. <city>CAIRO</city>
  312. <country>EG</country>
  313. <countryName>EGYPT</countryName>
  314. </address>
  315. </addresses>
  316. </entity>
  317. <entity id="1125610" version="20230414163054">
  318. <name>TAKAHASHI, KOICHI</name>
  319. <listId>1020</listId>
  320. <listCode>PEP</listCode>
  321. <entityType>03</entityType>
  322. <createdDate>09/02/2004</createdDate>
  323. <lastUpdateDate>04/14/2023</lastUpdateDate>
  324. <source>PEP</source>
  325. <OriginalSource>PEP</OriginalSource>
  326. <dobs>
  327. <dob Y="1944">1944</dob>
  328. </dobs>
  329. <nativeCharNames>
  330. <nativeCharName charSet="" latinCharName="TAKAHASHI, KOICHI" type="Primary">たかはし こういち</nativeCharName>
  331. <nativeCharName charSet="" latinCharName="TAKAHASHI, KOICHI" type="Primary">高橋 恒一</nativeCharName>
  332. </nativeCharNames>
  333. <titles>
  334. <title>FORMER AMBASSADOR OF JAPAN TO THE CZECH REPUBLIC (FEBRUARY 03, 2003 - 2005).</title>
  335. </titles>
  336. <sdfs>
  337. <sdf name="OtherInformation">Career: Ambassador of Japan to the Czech Republic (February 03, 2003 - 2005); Deputy Vice-Minister in charge of Immigration Bureau, Ministry of Justice (1999 - 2001); Consul-General of Japan to Berlin City, Germany (1995 - 1997); Minister of Japan to</sdf>
  338. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=9b2a063e-8d55-4806-b2f2-f2c79d815a33</sdf>
  339. <sdf name="EffectiveDate">1999</sdf>
  340. <sdf name="EntityLevel">National</sdf>
  341. <sdf name="ExpirationDate">2001</sdf>
  342. <sdf name="Gender">MALE</sdf>
  343. <sdf name="NameSource">Website</sdf>
  344. <sdf name="OriginalID">8483</sdf>
  345. <sdf name="SubCategory">Former PEP</sdf>
  346. </sdfs>
  347. <addresses>
  348. <address>
  349. <country>JP</country>
  350. <countryName>JAPAN</countryName>
  351. </address>
  352. </addresses>
  353. </entity>
  354. <entity id="1125925" version="20230414163054">
  355. <name>PINTER, SANDOR</name>
  356. <listId>1020</listId>
  357. <listCode>PEP</listCode>
  358. <entityType>03</entityType>
  359. <createdDate>09/02/2004</createdDate>
  360. <lastUpdateDate>04/14/2023</lastUpdateDate>
  361. <source>PEP</source>
  362. <OriginalSource>PEP</OriginalSource>
  363. <dobs>
  364. <dob Y="1948">07/03/1948</dob>
  365. </dobs>
  366. <pobs>
  367. <pob>Budapest, , Hungary</pob>
  368. </pobs>
  369. <titles>
  370. <title>DEPUTY PRIME MINISTER OF HUNGARY, EFFECTIVE FROM MAY 04, 2018.</title>
  371. </titles>
  372. <sdfs>
  373. <sdf name="OtherInformation">Career: Deputy Prime Minister, effective from May 04, 2018; Minister of Interior, effective from May 29, 2010; Minister of Interior (July 08, 1998 - May 27, 2002); Chief of the Hungarian National Police (September 18, 1991 - 1996).</sdf>
  374. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=cd135a22-6242-4999-bc6f-5aae5b0f92e2</sdf>
  375. <sdf name="EffectiveDate">2018</sdf>
  376. <sdf name="EntityLevel">National</sdf>
  377. <sdf name="Gender">MALE</sdf>
  378. <sdf name="NameSource">Website</sdf>
  379. <sdf name="Org_PID">2544374</sdf>
  380. <sdf name="OriginalID">11549</sdf>
  381. <sdf name="Relationship">Father</sdf>
  382. <sdf name="SubCategory">Govt Branch Member</sdf>
  383. </sdfs>
  384. <addresses>
  385. <address>
  386. <address1>TEVE U. 4-6.</address1>
  387. <city>BUDAPEST</city>
  388. <country>HU</country>
  389. <countryName>HUNGARY</countryName>
  390. <postalCode>1139</postalCode>
  391. </address>
  392. <address>
  393. <address1>JOZSEF ATTILA U. 2-4.</address1>
  394. <city>BUDAPEST</city>
  395. <country>HU</country>
  396. <countryName>HUNGARY</countryName>
  397. <postalCode>1051</postalCode>
  398. </address>
  399. </addresses>
  400. </entity>
  401. <entity id="1126129" version="20230414163055">
  402. <name>ROJAS GOMEZ, BAUTISTA ANTONIO</name>
  403. <listId>1020</listId>
  404. <listCode>PEP</listCode>
  405. <entityType>03</entityType>
  406. <createdDate>09/02/2004</createdDate>
  407. <lastUpdateDate>04/14/2023</lastUpdateDate>
  408. <source>PEP</source>
  409. <OriginalSource>PEP</OriginalSource>
  410. <dobs>
  411. <dob Y="1951">11/06/1951</dob>
  412. </dobs>
  413. <pobs>
  414. <pob>Salcedo, Hermanas Mirabal, Dominican Republic</pob>
  415. </pobs>
  416. <aliases>
  417. <alias type="Alias">ROJAS, BAUTA</alias>
  418. <alias type="Alias">ROJAS, BAUTISTA</alias>
  419. </aliases>
  420. <ids>
  421. <id type="NATIONAL NO">055-0018735-5</id>
  422. <id type="OtherID">055-0018735-5</id>
  423. </ids>
  424. <titles>
  425. <title>MEMBER OF THE NATIONAL CONGRESS OF DOMINICAN REPUBLIC (AUGUST 16, 2020 - AUGUST 16, 2024).</title>
  426. </titles>
  427. <sdfs>
  428. <sdf name="OtherInformation">NickName: Bauta; Political Party: Partido Reformista Social Cristiano (PRSC); La Fuerza del Pueblo (LFP), effective from October 2019; Partido de la Liberacion Dominicana (PLD),effective until October 21, 2019. Career: Member of the National Congress,</sdf>
  429. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=c9447508-1a77-470d-ba2d-0bdeb6119bbc</sdf>
  430. <sdf name="EffectiveDate">2020</sdf>
  431. <sdf name="EntityLevel">National</sdf>
  432. <sdf name="ExpirationDate">2024</sdf>
  433. <sdf name="Gender">MALE</sdf>
  434. <sdf name="NameSource">Website</sdf>
  435. <sdf name="Org_PID">3631988</sdf>
  436. <sdf name="OriginalID">9859</sdf>
  437. <sdf name="Relationship">Son</sdf>
  438. <sdf name="SubCategory">Govt Branch Member</sdf>
  439. </sdfs>
  440. <addresses>
  441. <address>
  442. <address1>AVE. ENRIQUE JIMENEZ MOYA</address1>
  443. <city>SANTO DOMINGO</city>
  444. <country>DO</country>
  445. <countryName>DOMINICAN REPUBLIC</countryName>
  446. <province>DISTRITO NACIONAL</province>
  447. </address>
  448. <address>
  449. <address1>C. DUARTE NO. 106</address1>
  450. <city>SALSEDO</city>
  451. <country>DO</country>
  452. <countryName>DOMINICAN REPUBLIC</countryName>
  453. <province>HERMANAS MIRABAL</province>
  454. </address>
  455. <address>
  456. <address1>AVE. INDEPENDENCIA 401</address1>
  457. <city>SANTO DOMINGO</city>
  458. <country>DO</country>
  459. <countryName>DOMINICAN REPUBLIC</countryName>
  460. <province>DISTRITO NACIONAL</province>
  461. </address>
  462. <address>
  463. <address1>AVE. CAYETANO GERMOSEN</address1>
  464. <city>SANTO DOMINGO</city>
  465. <country>DO</country>
  466. <countryName>DOMINICAN REPUBLIC</countryName>
  467. <province>DISTRITO NACIONAL</province>
  468. </address>
  469. <address>
  470. <address1>AVE. DR. HECTOR HOMERO HERNANDEZ</address1>
  471. <city>SANTO DOMINGO</city>
  472. <country>DO</country>
  473. <countryName>DOMINICAN REPUBLIC</countryName>
  474. <province>DISTRITO NACIONAL</province>
  475. </address>
  476. </addresses>
  477. </entity>
  478. <entity id="1126319" version="20230414163056">
  479. <name>SUMAYE, FREDERICK TLUWAY</name>
  480. <listId>1020</listId>
  481. <listCode>PEP</listCode>
  482. <entityType>03</entityType>
  483. <createdDate>09/02/2004</createdDate>
  484. <lastUpdateDate>04/14/2023</lastUpdateDate>
  485. <source>PEP</source>
  486. <OriginalSource>PEP</OriginalSource>
  487. <dobs>
  488. <dob Y="1950">05/29/1950</dob>
  489. </dobs>
  490. <pobs>
  491. <pob>Arusha region, Tanzania</pob>
  492. </pobs>
  493. <titles>
  494. <title>FORMER PRIME MINISTER OF TANZANIA (NOVEMBER 28, 1995 - DECEMBER 29, 2005).</title>
  495. </titles>
  496. <sdfs>
  497. <sdf name="OtherInformation">Political Party: Chama Cha Mapinduzi (CCM). Career: Prime Minister of Tanzania (November 28, 1995 - December 29, 2005); Deputy Minister for Agriculture, expiration reported July 08, 2016; Member of the Parliament of Tanzania (1983 - 2005); Board Member</sdf>
  498. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=caa97ebc-f3a0-4eb3-b7aa-ce0d30e24e04</sdf>
  499. <sdf name="EffectiveDate">1995</sdf>
  500. <sdf name="EntityLevel">National</sdf>
  501. <sdf name="ExpirationDate">2005</sdf>
  502. <sdf name="Gender">MALE</sdf>
  503. <sdf name="NameSource">Website</sdf>
  504. <sdf name="Org_PID">19471</sdf>
  505. <sdf name="OriginalID">9104</sdf>
  506. <sdf name="Relationship">Associate</sdf>
  507. <sdf name="SubCategory">Govt Branch Member</sdf>
  508. </sdfs>
  509. <addresses>
  510. <address>
  511. <country>TZ</country>
  512. <countryName>TANZANIA, UNITED REPUBLIC OF</countryName>
  513. <province>DODOMA</province>
  514. </address>
  515. </addresses>
  516. </entity>
  517. <entity id="1126418" version="20230414163056">
  518. <name>BORGINON, ALFONS</name>
  519. <listId>1020</listId>
  520. <listCode>PEP</listCode>
  521. <entityType>03</entityType>
  522. <createdDate>09/02/2004</createdDate>
  523. <lastUpdateDate>04/14/2023</lastUpdateDate>
  524. <source>PEP</source>
  525. <OriginalSource>PEP</OriginalSource>
  526. <dobs>
  527. <dob Y="1966">07/12/1966</dob>
  528. </dobs>
  529. <pobs>
  530. <pob>Lier, , Belgium</pob>
  531. </pobs>
  532. <aliases>
  533. <alias type="Alias">BORGINON, FONS</alias>
  534. </aliases>
  535. <titles>
  536. <title>FORMER MEMBER OF THE FEDERAL PARLIAMENT OF BELGIUM (MAY 21, 1995 - MAY 02, 2007).</title>
  537. </titles>
  538. <sdfs>
  539. <sdf name="OtherInformation">Political Party: Open Vlaamse Liberalen en Democraten (OpenVLD). Career: Member of the Federal Parliament, Chamber of Representatives, from Antwerp (May 21, 1995 - May 02, 2007).; Member of the Party Board of Open Vlaamse Liberalen en Democraten,</sdf>
  540. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=772a87d7-d838-4dd7-8c7a-57bcd3a17b74</sdf>
  541. <sdf name="EffectiveDate">1995</sdf>
  542. <sdf name="EntityLevel">National</sdf>
  543. <sdf name="ExpirationDate">2007</sdf>
  544. <sdf name="Gender">MALE</sdf>
  545. <sdf name="NameSource">Website</sdf>
  546. <sdf name="Org_PID">1251967</sdf>
  547. <sdf name="OriginalID">9235</sdf>
  548. <sdf name="Relationship">Father</sdf>
  549. <sdf name="SubCategory">Former PEP</sdf>
  550. </sdfs>
  551. <addresses>
  552. <address>
  553. <address1>RUE DE LOUVAIN 13</address1>
  554. <city>BRUSSELS</city>
  555. <country>BE</country>
  556. <countryName>BELGIUM</countryName>
  557. <postalCode>1000</postalCode>
  558. </address>
  559. <address>
  560. <city>BRUSSELS</city>
  561. <country>BE</country>
  562. <countryName>BELGIUM</countryName>
  563. <postalCode>1008</postalCode>
  564. </address>
  565. </addresses>
  566. </entity>
  567. <entity id="1126731" version="20230414163057">
  568. <name>DUQUESNE, ANTOINE</name>
  569. <listId>1020</listId>
  570. <listCode>PEP</listCode>
  571. <entityType>03</entityType>
  572. <createdDate>09/02/2004</createdDate>
  573. <lastUpdateDate>04/14/2023</lastUpdateDate>
  574. <source>PEP</source>
  575. <OriginalSource>PEP</OriginalSource>
  576. <dobs>
  577. <dob Y="1941">02/03/1941</dob>
  578. </dobs>
  579. <pobs>
  580. <pob>Ixelles, , Belgium</pob>
  581. </pobs>
  582. <titles>
  583. <title>FORMER MINISTER OF THE INTERIOR OF BELGIUM (JULY 12, 1999 - JULY 11, 2003). DECEASED ON NOVEMBER 04, 2010.</title>
  584. </titles>
  585. <sdfs>
  586. <sdf name="OtherInformation">Political Party: Mouvement Reformateur (MR). Career: Minister of the Interior (July 12, 1999 - July 11, 2003); Member of the European Parliament (July 20, 2004 - July 13, 2009); Member of the Federal Parliament, Senate (2003 - July 20, 2004); President</sdf>
  587. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=3879f351-8e1e-479d-8cab-f24acb2537d2</sdf>
  588. <sdf name="EffectiveDate">1982</sdf>
  589. <sdf name="EntityLevel">National</sdf>
  590. <sdf name="ExpirationDate">1987</sdf>
  591. <sdf name="Gender">MALE</sdf>
  592. <sdf name="NameSource">Website</sdf>
  593. <sdf name="Org_PID">648547</sdf>
  594. <sdf name="OriginalID">10706</sdf>
  595. <sdf name="Relationship">Father</sdf>
  596. <sdf name="SubCategory">Former PEP</sdf>
  597. </sdfs>
  598. <addresses>
  599. <address>
  600. <city>BRUSSELS</city>
  601. <country>BE</country>
  602. <countryName>BELGIUM</countryName>
  603. <postalCode>1008</postalCode>
  604. </address>
  605. <address>
  606. <address1>PLACE DE LA NATION 1</address1>
  607. <city>BRUSSELS</city>
  608. <country>BE</country>
  609. <countryName>BELGIUM</countryName>
  610. <postalCode>1009</postalCode>
  611. </address>
  612. <address>
  613. <address1>SQUARE ARTHUR MASSON 6</address1>
  614. <city>NAMUR</city>
  615. <country>BE</country>
  616. <countryName>BELGIUM</countryName>
  617. <postalCode>5012</postalCode>
  618. </address>
  619. <address>
  620. <address1>RUE DE LA LOI 6</address1>
  621. <city>BRUXELLES</city>
  622. <country>BE</country>
  623. <countryName>BELGIUM</countryName>
  624. <postalCode>1000</postalCode>
  625. </address>
  626. </addresses>
  627. </entity>
  628. <entity id="1127109" version="20230414163058">
  629. <name>LE PEN, MARION ANNE PERRINE</name>
  630. <listId>1020</listId>
  631. <listCode>PEP</listCode>
  632. <entityType>03</entityType>
  633. <createdDate>09/02/2004</createdDate>
  634. <lastUpdateDate>04/14/2023</lastUpdateDate>
  635. <source>PEP</source>
  636. <OriginalSource>PEP</OriginalSource>
  637. <dobs>
  638. <dob Y="1968">08/05/1968</dob>
  639. </dobs>
  640. <pobs>
  641. <pob>Neuilly-sur-Seine, , France</pob>
  642. </pobs>
  643. <aliases>
  644. <alias type="Alias">LE PEN, MARINE</alias>
  645. </aliases>
  646. <titles>
  647. <title>MEMBER OF THE DEPARTMENTAL COUNCIL OF PAS-DE-CALAIS (JULY 01, 2021 - MARCH 2028).</title>
  648. </titles>
  649. <sdfs>
  650. <sdf name="OtherInformation">According to the leparisien.fr; April 16, 2022: The European Anti-Fraud Office (OLAF) has published a report accusing Marine Le Pen, Jean-Marie Le Pen, Louis Aliot, and Bruno Gollnisch of embezzlement. The EU's anti-fraud body suspects the four former</sdf>
  651. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=15f81656-1d20-4308-8d20-b74a6e77bbef</sdf>
  652. <sdf name="EffectiveDate">2017</sdf>
  653. <sdf name="EntityLevel">National</sdf>
  654. <sdf name="ExpirationDate">2027</sdf>
  655. <sdf name="Gender">FEMALE</sdf>
  656. <sdf name="NameSource">Website</sdf>
  657. <sdf name="Org_PID">24847</sdf>
  658. <sdf name="OriginalID">10010</sdf>
  659. <sdf name="Relationship">Associate</sdf>
  660. <sdf name="SubCategory">Govt Branch Member</sdf>
  661. <sdf name="Watch">Negative News Alert</sdf>
  662. </sdfs>
  663. <addresses>
  664. <address>
  665. <address1>151, AVENUE DU PRESIDENT HOOVER</address1>
  666. <city>LILLE</city>
  667. <country>FR</country>
  668. <countryName>FRANCE</countryName>
  669. <postalCode>59555</postalCode>
  670. </address>
  671. <address>
  672. <address1>126, RUE DE L'UNIVERSITE</address1>
  673. <city>PARIS</city>
  674. <country>FR</country>
  675. <countryName>FRANCE</countryName>
  676. <postalCode>75355</postalCode>
  677. </address>
  678. <address>
  679. <address1>1, AVENUE DU PRESIDENT ROBERT SCHUMAN</address1>
  680. <city>STRASBOURG</city>
  681. <country>FR</country>
  682. <countryName>FRANCE</countryName>
  683. <postalCode>67070</postalCode>
  684. </address>
  685. <address>
  686. <address1>RUE WIERTZ 60</address1>
  687. <city>BRUSSELS</city>
  688. <country>BE</country>
  689. <countryName>BELGIUM</countryName>
  690. <postalCode>1047</postalCode>
  691. </address>
  692. </addresses>
  693. </entity>
  694. <entity id="1127428" version="20230414163059">
  695. <name>MARINCEK, ALOJZIJ</name>
  696. <listId>1020</listId>
  697. <listCode>PEP</listCode>
  698. <entityType>03</entityType>
  699. <createdDate>09/02/2004</createdDate>
  700. <lastUpdateDate>04/14/2023</lastUpdateDate>
  701. <source>PEP</source>
  702. <OriginalSource>PEP</OriginalSource>
  703. <dobs>
  704. <dob Y="1932">04/23/1932</dob>
  705. </dobs>
  706. <pobs>
  707. <pob>Ljubljana, , Slovenia</pob>
  708. </pobs>
  709. <aliases>
  710. <alias type="Alias">MARINCEK, LOJZE</alias>
  711. </aliases>
  712. <titles>
  713. <title>FORMER MINISTER OF SCIENCE AND TECHNOLOGY OF SLOVENIA (FEBRUARY 27, 1997 - NOVEMBER 30, 2000). DECEASED APRIL 08, 2023.</title>
  714. </titles>
  715. <sdfs>
  716. <sdf name="OtherInformation">Political Party: Slovenian People's Party (SLS) Career: Minister of Science and Technology (February 27, 1997 - November 30, 2000).</sdf>
  717. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=995cb646-0283-49a1-8ac1-d393c1b1fc11</sdf>
  718. <sdf name="EffectiveDate">1997</sdf>
  719. <sdf name="EntityLevel">National</sdf>
  720. <sdf name="ExpirationDate">2000</sdf>
  721. <sdf name="Gender">MALE</sdf>
  722. <sdf name="NameSource">Website</sdf>
  723. <sdf name="OriginalID">11170</sdf>
  724. <sdf name="SubCategory">Former PEP</sdf>
  725. </sdfs>
  726. <addresses>
  727. <address>
  728. <country>SI</country>
  729. <countryName>SLOVENIA</countryName>
  730. </address>
  731. </addresses>
  732. </entity>
  733. <entity id="1127700" version="20230414163100">
  734. <name>DEUTSCH, TAMAS</name>
  735. <listId>1020</listId>
  736. <listCode>PEP</listCode>
  737. <entityType>03</entityType>
  738. <createdDate>09/02/2004</createdDate>
  739. <lastUpdateDate>04/14/2023</lastUpdateDate>
  740. <source>PEP</source>
  741. <OriginalSource>PEP</OriginalSource>
  742. <dobs>
  743. <dob Y="1966">07/27/1966</dob>
  744. </dobs>
  745. <pobs>
  746. <pob>Budapest, , Hungary</pob>
  747. </pobs>
  748. <aliases>
  749. <alias type="Alias">DEUTSCH-FUER, TAMAS</alias>
  750. </aliases>
  751. <titles>
  752. <title>MEMBER OF THE EUROPEAN PARLIAMENT, EFFECTIVE FROM JULY 16, 2009.</title>
  753. </titles>
  754. <sdfs>
  755. <sdf name="OtherInformation">Political Party: Magyar Polgari Szovetseg (Fidesz), effective from March 30, 1988. Career: Member of the European Parliament, effective from July 16, 2009; Minister of Youth and Sport (January 01, 1999 - May 26, 2002); Member of the Parliament (May 16,</sdf>
  756. <sdf name="DirectID">https://accuity.worldcompliance.com/signin.aspx?ent=a2ce856d-81bc-4af8-bbac-b948ef167e0e</sdf>
  757. <sdf name="EffectiveDate">2009</sdf>
  758. <sdf name="EntityLevel">International</sdf>
  759. <sdf name="Gender">MALE</sdf>
  760. <sdf name="NameSource">Website</sdf>
  761. <sdf name="Org_PID">203703</sdf>
  762. <sdf name="OriginalID">10525</sdf>
  763. <sdf name="Relationship">Son</sdf>
  764. <sdf name="SubCategory">Intl Org Leadership</sdf>
  765. </sdfs>
  766. <addresses>
  767. <address>
  768. <address1>WIERTZSTRAAT 60</address1>
  769. <city>BRUXELLES</city>
  770. <country>BE</country>
  771. <countryName>BELGIUM</countryName>
  772. <postalCode>B-1047</postalCode>
  773. </address>
  774. <address>
  775. <address1>KOSSUTH TER 1-3.</address1>
  776. <city>BUDAPEST</city>
  777. <country>HU</country>
  778. <countryName>HUNGARY</countryName>
  779. <postalCode>1055</postalCode>
  780. </address>
  781. <address>
  782. <address1>1, AVENUE DU PRESIDENT ROBERT SCHUMAN</address1>
  783. <city>STRASBOURG</city>
  784. <country>FR</country>
  785. <countryName>FRANCE</countryName>
  786. <postalCode>F-67070</postalCode>
  787. </address>
  788. </addresses>
  789. </entity>
  790. </entities>
  791. </gwl>

XML解析方法有四种,这里用DOM解析

Java代码如下:

  1. import java.io.File;
  2. import java.io.FileWriter;
  3. import java.io.PrintWriter;
  4. import java.io.StringWriter;
  5. import javax.xml.parsers.DocumentBuilder;
  6. import javax.xml.parsers.DocumentBuilderFactory;
  7. import javax.xml.transform.OutputKeys;
  8. import javax.xml.transform.Transformer;
  9. import javax.xml.transform.TransformerFactory;
  10. import javax.xml.transform.dom.DOMSource;
  11. import javax.xml.transform.stream.StreamResult;
  12. import org.w3c.dom.Document;
  13. import org.w3c.dom.Node;
  14. import org.w3c.dom.NodeList;
  15. public class ParserXMLTest {
  16. public static void main(String[] args) {
  17. try {
  18. // 加载XML文件
  19. System.out.println("开始加载xml文件");
  20. File inputFile = new File("D:/develop/TestWord/RosterResolveTest.xml");
  21. DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
  22. DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
  23. Document doc = dBuilder.parse(inputFile);
  24. // 获取所有entity节点
  25. NodeList entityList = doc.getElementsByTagName("entity");
  26. // 计算每个文件应该写入的entity数量
  27. //获取文件entity结点总数
  28. int count = entityList.getLength();
  29. //7个文件中,每个文件平均存多少条entity
  30. int perFile = count / 7;
  31. //拿到平均分配后多出来的数据
  32. int remainder = count % 7;
  33. //创建7个数组文件
  34. int[] fileCounts = new int[7];
  35. //将entity平均存入7个数组中
  36. for (int i = 0; i < 7; i++) {
  37. fileCounts[i] = perFile;
  38. if (i < remainder) {
  39. fileCounts[i]++;
  40. }
  41. }
  42. // 写入文件
  43. int entityIndex = 0;
  44. for (int i = 0; i < 7; i++) {
  45. File outputFile = new File("D:/develop/TestWord/ParserResult3/Entity" + (i+1) + ".xml");
  46. PrintWriter writer = new PrintWriter(new FileWriter(outputFile));
  47. writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
  48. "<gwl>\r\n" +
  49. "<version>20230417084108</version>\r\n" +
  50. "<entities>");
  51. for (int j = 0; j < fileCounts[i]; j++) {
  52. Node entity = entityList.item(entityIndex++);
  53. String xml = nodeToString(entity);
  54. writer.println(xml);
  55. }
  56. writer.println("</entities>\r\n" +
  57. "</gwl>");
  58. System.out.println("开始写入新的xml文件:" + outputFile);
  59. writer.close();
  60. }
  61. } catch (Exception e) {
  62. e.printStackTrace();
  63. }
  64. System.out.println("xml名单entity解析完成!");
  65. }
  66. // 将节点转换为XML字符串
  67. private static String nodeToString(Node node) throws Exception {
  68. StringWriter sw = new StringWriter();
  69. TransformerFactory tf = TransformerFactory.newInstance();
  70. Transformer transformer = tf.newTransformer();
  71. transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
  72. transformer.transform(new DOMSource(node), new StreamResult(sw));
  73. return sw.toString();
  74. }
  75. }

解析结果:

 第一个文件中有三条数据,其他6个文件中,平均存入2条数据

 

 解析完成!

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
  

闽ICP备14008679号