I want to compare two files: one is xml file and the other is text file. If there is a string that appears in the xml file but not in the text file, it will be deleted from xml file.
I tried using xml.nsh and also function FileSearch to compare them. After I remove one node, the looping always stop because it cannot find the nextsibling. Any idea how to continue the loop?
${xml::LoadFile} "$TEMP\$IISXMLFile" $0
${xml::GotoPath} "/unattend/servicing/package" $0
${xml::FirstChild} "assemblyIdentity" $1 $0
${xml::NextSibling} "selection" $7 $0
${While} $0 == 0
${xml::GetAttribute} "name" $3 $4
Push $TEMP\featurelist.txt
Push $3
Call FileSearch
Pop $0 #Number of times found throughout
Pop $1 #Number of lines found on
${IF} $0 == 0
${xml::RemoveNode} $7
${ENDIF}
${xml::NextSibling} "selection" $7 $0
${EndWhile}
${xml::SaveFile} "$TEMP\$IISXMLFile" $0
${xml::NodeHandle} $0
${xml::Unload}
No comments:
Post a Comment