小编Max*_*xim的帖子

如何在Powershell中打印xml元素的实际内容?

当尝试使用powershell解析xml文件中的各种数据时,能够看到各种元素实际上是什么,进行调试等会很有用。所以,如果我有这样的事情:

[xml]$xmldoc = Get-Content doc.xml
$node = $xmldoc.SelectSingleNode("contents/some/path/items/item[name='itemname']")
$items = $xmldoc.contents.some.path.items

write-host "items = [${items}], node = [${node}]"
Run Code Online (Sandbox Code Playgroud)

我希望能够看到$ items和$ node的内容,但是我得到的只是System.Xml.XmlDocument或System.Xml.XmlElement。当我尝试使用items.Value或items.InnerText时,它们显示为空,那么如何打印这些元素的实际文本?

xml powershell xml-parsing

4
推荐指数
1
解决办法
2298
查看次数

如何在 Visual Studio 中查看 static_assert 的“失败源”?

在 Visual Studio 中尝试编译时,我得到一个 static_assert,但是当我单击该错误时,它需要断言本身而不是有问题的行。

如何找出哪一行触发了static_assert?

c++ static-assert visual-studio-2015

1
推荐指数
1
解决办法
635
查看次数