Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<act contract="646" type="2">
<tests>
<test level="30">
<people>
<man is_retry="0" citizen="13" gender="f">
<surname_lat>GURBANOVA</surname_lat>
<name_lat>GARANFIL</name_lat>
<passport_series>P</passport_series>
<passport>3906597</passport>
<passport_date>16.11.2009</passport_date>
<migration_card_series>122</migration_card_series>
<migration_card_number>332233</migration_card_number>
<subtests>
<subtest num="1">2</subtest>
<subtest num="2">1</subtest>
<subtest num="3">3</subtest>
<subtest num="4">2</subtest>
<subtest num="5">4</subtest>
<subtest num="6">4</subtest>
</subtests>
</man>
</people>
</test>
</tests>
</act>
Code: Select all
filePath := A_Desktop "\test.xml"
xmlDoc := ComObjCreate("Microsoft.XMLDOM")
xmlDoc.load(filePath)
coll := xmlDoc.getElementsByTagName("people")
for item in coll
{
vendor := item.getElementsByTagName("man").(0)
vendor.removeChild(vendor)
}
MsgBox % xmlDoc.xml
ExitApp