How to delete XML comments

后端 未结 2 906
青春惊慌失措
青春惊慌失措 2021-01-14 16:43

I wrote a VBScript to remove all the comments in a XML file. But it didn\'t work correctly. The script reads from a .xml file, generates a XML file which removes comments an

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-14 17:14

    You can try with something like

    With WScript.CreateObject("msxml2.DOMDocument.6.0")
        .Async = False
        .Load "in.xml"
        .SelectNodes("//comment()").RemoveAll
        .Save "out.xml"
    End With 
    

提交回复
热议问题