From d75ca87d53f7ef74755bee034229ded364e7d0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=93=D0=BE?= =?UTF-8?q?=D0=BB=D1=83=D0=B1=D0=B5=D0=B2?= Date: Wed, 25 Jul 2018 19:39:14 +0300 Subject: [PATCH] lishnee --- XmlTest/Program.cs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/XmlTest/Program.cs b/XmlTest/Program.cs index 5a43abf..682e261 100644 --- a/XmlTest/Program.cs +++ b/XmlTest/Program.cs @@ -18,13 +18,30 @@ namespace XmlTest xDoc.Load("..\\..\\..\\vertical.xml"); XmlElement xRoot = xDoc.DocumentElement; - - XmlNodeList childnodes = xRoot.XPath2SelectNodes("//Object[ends-with(@Name,'_oper')], //Object[ends-with(@Name,'_step')]"); - if (childnodes != null) - foreach (XmlNode n in childnodes) + + XmlNodeList mySearch = xRoot.XPath2SelectNodes("//Object[ends-with(@Name,'_oper')]"); + if (mySearch != null) + foreach (XmlNode n in mySearch) + { + Console.WriteLine(n.SelectSingleNode("Attribute").OuterXml); + + } + + + + //XmlNodeList childnodes = xRoot.XPath2SelectNodes("//Object[ends-with(@Name,'_oper')], //Object[ends-with(@Name,'_step')]"); + //if (childnodes != null) + // foreach (XmlNode n in childnodes) + // { + // Console.WriteLine(n.SelectSingleNode("Attribute").OuterXml); + + // foreach (XmlNode s in n) + // Console.WriteLine + // } + Console.WriteLine("Press Any Key"); Console.ReadKey();