Created
January 24, 2024 11:51
-
-
Save jskeet/37a0b979b59da8ece16867eb1f338a04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Xml.Linq; | |
var doc = XDocument.Load("test.xml"); | |
var matches = doc | |
.Descendants("aircraft_info") | |
.Where(ft => ((string)ft.Element("aircraft_name")) == "Default"); | |
// Prints 1 | |
Console.WriteLine(matches.Count()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment