opening/saving xml while preserving newline between node's attributes

后端 未结 2 1118
忘了有多久
忘了有多久 2021-01-13 08:49

This is what I have so far:

$XML = New-Object System.Xml.XmlDocument
$XML.PreserveWhitespace = $true
$XML.Load($path)
#change some node attributes
$XML.Save(         


        
2条回答
  •  隐瞒了意图╮
    2021-01-13 09:34

    No XML parser in the world is going to tell you whether the attributes in a start tag are separated by spaces, newlines, or tabs. You aren't supposed to care.

提交回复
热议问题