电源外壳:
$doc = new-object System.Xml.XmlDocument
$doc.Load($filename)
$items = Select-Xml -Xml $doc -XPath '//item'
$items | foreach {
$item = $_
write-host $item.name
}
我没有输出
XML:
<?xml version="1.0" encoding="UTF-8"?>
<submission version="2.0" type="TREE" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:noNamespaceSchemaLocation="TREE.xsd" xmlns="some/kind/of/tree/v1">
<group>
<item></item>
<item></item>
<item></item>
</group>
<submission>