Reputation:
It seem the System.Xml
is not available in .net core (unit test)
I found a nu get package called DocumentFormat.OpenXml but couldn't find code examples on how to use one.
My requirement is simple to be able to parse a single element like this. Any suggestions.
"<message Att='Hello'/>"
Upvotes: 6
Views: 8017
Reputation: 6749
I see a comment for using Linq and recommend going that route. That said, I personally haven't tried it in .NET Core.
Try something like...
var value = "<message Att='Hello'/>";
var xml = XDocument.Parse(value);
Upvotes: 5