I have huge list of XML files (over 100 000) and wanted to access specific node value in each of them using powershell. Issue I'm having is that all of them have namespaces that take you nowhere. Do you know what would be the best way to ignore it?
1 Answer
[xml]$xml = Get-Content file.xml
Then access $xml as a PowerShell object (e.g. $xml.some.node).
3 Comments
montonero
This does not answer OPs question regarding namespaces.
Ansgar Wiechers
@montonero It does answer the question, since dot-accessing the XML data structure ignores namespaces.
Chris Arbogast
In my case I found that $xml was empty if file.xml had namespaces or maybe xsd references that could not be resolved. So there is that.