Open lupusbytes opened 3 years ago
In Pwsh I do:
[xml]$a = Get-Content .\[filename].xml
So your var should be some xml variable upfront.
In .Net, C# something like:
internal static void ReadXMLFileUsingXMLDocument()
{
XmlDocument xmlDcoument = new XmlDocument();
xmlDcoument.Load(@"EmployeeData.xml");
XmlNodeList? xmlNodeList = xmlDcoument.DocumentElement.SelectNodes("/Employees/Employee");
Console.WriteLine("Output using XMLDocument");
foreach (XmlNode xmlNode in xmlNodeList)
{
Console.WriteLine("Id of the Employee is : " + xmlNode.SelectSingleNode("Id").InnerText);
Console.WriteLine("Name of the Employee is : " + xmlNode.SelectSingleNode("Name").InnerText);
Console.WriteLine();
}
}
I'm trying to load a UtilityStatement document using
var result = UblDocument.Load<UtilityStatementType>(new FileStream(...), FileMode.Open, FileAccess.Read)
The document starts like this.
I get an InvalidOperationException
Online validators like http://www.oioubl.net/validator/ confirms that the document is valid.
What is the reason for the exception ?