If I have the following xml:
<staff>
<employee>
<Name>Bob Smith</Name>
<function>management</function>
<age>39</age>
<stuff>
<data>Some Data</data>
</stuff>
</employee>
<employee>
<Name>Sam Jones</Name>
<function>security</function>
<age>24</age>
<stuff>
<data>Some Other Data</data>
</stuff>
</employee>
</staff>
I can access this with:
$FilePath = "c:\test.xml"
$XmlFiles = @()
$Index = -1
$xdoc = new-object System.Xml.XmlDocument
$xdoc.load($FilePath)
$xdoc.SelectNodes("//employee")
This returns all the information.
But for < stuff >
it just says stuff
, it doesn't expand it to show the content of the < data >
field.
How can I get it to show everything for each employee, including the < data >
field?