user7014993
user7014993

Reputation:

xml parsing in C# .net Core

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

Answers (1)

Michael Puckett II
Michael Puckett II

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

Related Questions