0
我只想知道如何使用XDocument评论整个元素。XDocument如何评论元素
XDocument doc = XDocument.Parse("<configuration>
<connectionString>
...
</connectionString>
<configuration>");
/*Something like that*/ doc.Root.Element("connectionStrings").NodeType = XComment; /*??*/
诅咒你,Skeet!我写的是同样的东西,但是后来你写得更快更好。哈哈,+1! –
我想要所有的子节点都在注释全部替换? – C1rdec
@Cedric:他们已经是 - 全都在评论部分。 (如果你列出了上面所有的后代元素,它*不会显示'nestedElement'。) –