Given the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2014-12-03T13:58:05.5136628</Date>
<Author>ABCCORP\jsmith</Author>
</RegistrationInfo>
</Task>
I can access the Task node using SelectNodes as follows:
[xml]$xml = gc C:\temp\myxml.xml
$ns = new-object Xml.XmlNamespaceManager $xml.NameTable
$ns.AddNamespace("ns0", "http://schemas.microsoft.com/windows/2004/02/mit/task")
$xml.SelectNodes("ns0:Task", $ns)
But I can't access child nodes. For example, this returns null:
$xml.SelectNodes("ns0:Task/RegistrationInfo", $ns)
What is the correct syntax for accessing child nodes?