TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vishal Kaushik
NA
3
3k
XML to CSV parser with column names in C#
Jan 28 2020 2:27 PM
Please help me to parse my xml into csv with column names. I need c# code in order to achieve my task. Below is my xml content:
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
soap:Envelope
xmlns:xsd
=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap
=
"http://schemas.xmlsoap.org/soap/envelope/"
>
<
soap:Body
>
<
GetAccountsResponse
xmlns
=
"http://Weiland.Ba.retrieval/"
>
<
GetAccountsResult
>
<
AccountRecords
>
3071
</
AccountRecords
>
<
Accounts
>
<
Account
>
<
AccountId
>
6
</
AccountId
>
<
AccountNumber
>
000091016138
</
AccountNumber
>
<
AccountTitle
>
3946231 Canada Inc.
</
AccountTitle
>
<
BankId
>
70
</
BankId
>
<
BankName
>
Royal Bank of Canada
</
BankName
>
<
BankRtn
>
ROYCCAT2
</
BankRtn
>
<
BranchId
xsi:nil
=
"true"
/>
<
CompanyId
>
86
</
CompanyId
>
<
CurrencyName
>
Canada, Dollar
</
CurrencyName
>
<
CostCenter
>
4603
</
CostCenter
>
<
ActiveDate
>
1900-01-01T00:00:00
</
ActiveDate
>
</
Account
>
</
Accounts
>
<
AsOfDate
>
2019-10-31 06:04:36.059 -04:00
</
AsOfDate
>
<
BankRecords
>
0
</
BankRecords
>
<
CompanyRecords
>
0
</
CompanyRecords
>
<
ReturnCode
>
0
</
ReturnCode
>
<
Version
>
1.03
</
Version
>
</
GetAccountsResult
>
</
GetAccountsResponse
>
</
soap:Body
>
</
soap:Envelope
>
I need the value of tags from AccountId to ActiveDate. I have tried looking on google but not able to get right code. Please help me so that I can generate a csv file from above xml content with column names in csv file.
Reply
Answers (
2
)
I want to read .pmd file content and store in database
how to pass set value in one method to another