/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source2.cs
27 строк
662 B
Genevieve Warren
Remarks from System.Xml* types (#38946)
03 янв 2024, 21:01
Не верифицирован
03 янв 2024, 21:01
eeaee26
Код
Авторство
О чём код?
// <Snippet1> using System; using System.Xml; public class Sample2 { public static void Main() { XmlDocument doc = new XmlDocument(); doc.LoadXml("<book ISBN='1-861001-57-5'>" + "<title>Pride And Prejudice</title>" + "<price>19.95</price>" + "</book>"); XmlNode root = doc.FirstChild; //Display the contents of the child nodes. if (root.HasChildNodes) { for (int i = 0; i < root.ChildNodes.Count; i++) { Console.WriteLine(root.ChildNodes[i].InnerText); } } } } // </Snippet1>