Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Non-standard xml and powershell

$
0
0

a document that has a number of xml elements in it,  but is not a standard xml document.

 

As a result, when I run this command:

$Data = [Xml] (Get-Content "C:\test.nsxml")

 

I get this error

 

Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "The specified node cannot be 
inserted as the valid child of this node, because the specified node is the wrong type."

 

The problem is that I can't convert the document to standard xml because it is used by a third party application that needs to have the file in its proprietary format.  Yet I need to manipulate the xml elements in it so I can customize the file.

 

What can I do?

 

Thanks!


Viewing all articles
Browse latest Browse all 6937

Trending Articles