XML Parsing

  • Thread starter Thread starter Manikandan S
  • Start date Start date
M

Manikandan S

Guest
Hi, I am parsing a XML below using my code below


if (arrange == DataArrange.Element)
{
foreach (XElement innnerval in data.Elements())
{
builder.Append(innnerval.Value);
builder.Append(Columnseparater);
}
builder.Remove(builder.Length - 1, 1);
}

And I got the output too. Like below,

N1|A1|IT
N2|A2|CSE

XML:

<Employees>
<Employee>
<name>N1</name>
<address>A1</address>
<dept>IT</dept>
</Employee>
<Employee>
<name>N2</name>
<address>A2</address>
<dept>CSE</dept>
</Employee>
</Employees>


Now, I want the header to be included to my delimited file, How can I fetch that, Please help. My output should be like this.


Name|address|dept

N1|A1|IT
N2|A2|CSE


I am using Xdocument and XElement of LINQ.

Continue reading...
 
Back
Top