is it possible to differentiate the origin of a value in XML data (attribute or element) once the data has been read? if I run the following script
$xml= [xml]@'
<?xml version="1.0" encoding="utf-8"?>
<root>
<item id="001">
</item>
<item>
<id>002</id>
</item>
<item id="003">
<id>003 bis</id>
</item>
</root>
'@
$items = Select-Xml -Xml $xml -XPath '//item'
$items | %{ $_.node }
I get the same structure in $_.node
for id
for the two first items and an array of values for id
for the last one
id
--
001
002
{003, 003 bis}