0

I have a xml file with the following format :

<list name="a">
<person>        
    <field name="Name">aaa</field>
    <field name="lname">bb'b'</field>
    <field name="tel">123</field>
    <field name="tel">1234</field>
    <field name="tel">12345</field>
</person>
<person>        
    <field name="Name">vvv</field>
    <field name="lname">fff'</field>
    <field name="tel">1</field>
    <field name="tel">2</field>
    <field name="tel">3</field>
</person>
<person>        
    <field name="Name">ccc</field>
    <field name="lname">bb:'c'</field>
    <field name="tel">4</field>
    <field name="tel">5</field>
    <field name="tel">6</field>
</person>
</list>

and the following struct :

struct person
{
string name;
string lname;
string[] tel;
}

I got confused between different methods to read and write xml with following format I did my best to try methods T but not the result I wanted

I want to :

  • read the file and put the contents to struct array or dataTable to show in gridView.
  • write dataTable or Struct to a file with exacly same format as the input

I did my best to try methods , but not the result I wanted also the xmlWriter doesn't escape the ' and " in values like :

bb&apos;b&apos; instead of bb'b'

I tried following methods : xmlserializer xmlReader xmlWriter generating text manualy

M Oj
  • 39
  • 1
  • 3

0 Answers0