XML : Parsing XML file in C# (with using xmlschemas?)

How can I parse this XML file?

  <?xml version="1.0" encoding="UTF-8"?>  <V8Exch:_1CV8DtUD xmlns:V8Exch="http://www.1c.ru/V8/1CV8DtUD/" xmlns:core="http://v8.1c.ru/data" xmlns:v8="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">    <V8Exch:Data>  <v8:CatalogObject.Obj>        <v8:IsFolder>false</v8:IsFolder>            <v8:Ref xsi:type="v8:CatalogRef.Фізичніособи">433da912-9da5-11e5-822a-f079599615ce</v8:Ref>  <v8:DeletionMark>false</v8:DeletionMark>        <v8:Parent xsi:type="v8:CatalogRef.Фізичніособи">4541cd82-9cfb-11e5-b79c-f079599615ce</v8:Parent>        <v8:Code>000000007</v8:Code>        <v8:Description>FullName</v8:Description>        <v8:LastNmae>LastNmae</v8:LastNmae>        <v8:FirstName>FirstName</v8:FirstName>        <v8:SecondName>SecondName</v8:SecondName>        <v8:Edu>          <v8:НомерДиплома> 1234 </v8:НомерДиплома>          <v8:НазваНавчельногоЗакладу>Iмені Івана Франка</v8:НазваНавчельногоЗакладу>          <v8:датаВидачіДиплома>1981-06-27T00:00:00</v8:датаВидачіДиплома>        </v8:Edu>      </v8:CatalogObject.Obj>    </V8Exch:Data>    <PredefinedData/>  </V8Exch:_1CV8DtUD>    

I'm trying touse this C#

  foreach (XmlNode node in doc.SelectNodes("CatalogObject"))                  {   XmlDocument doc = new XmlDocument();                      doc.Load("C:\\1.xml");                      foreach (XmlNode child in node.ChildNodes)                          richTextBox1.AppendText(string.Format("{0} = {1}", child.Name, child.InnerText));                      richTextBox1.AppendText("--------------");                  }    

code, but it isn't work for this file. It just do nothing. What i must to use to parse this file? Thank you!

No comments:

Post a Comment