/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System.Xml/XmlDocument/Overview/csharp/source6.cs
27 строк
624 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 Sample6 { public static void Main() { XmlDocument doc = new XmlDocument(); doc.Load("booksort.xml"); XmlNodeList nodeList; XmlNode root = doc.DocumentElement; nodeList = root.SelectNodes("descendant::book[author/last-name='Austen']"); //Change the price on the books. foreach (XmlNode book in nodeList) { book.LastChild.InnerText = "15.95"; } Console.WriteLine("Display the modified XML document...."); doc.Save(Console.Out); } } // </Snippet1>