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
Amit Sharma
NA
23
4.8k
Merge multiple xml files in one file
Oct 19 2020 3:18 AM
Hi friend,
I tried this but I am getting an error (Error: 'XDocument' does not contain a definition for 'Dump' and no extension method 'Dump' accepting a first argument of type 'XDocument'could be found ) on masterfile.Dump();
Can anyone help regarding this error ???
MY CODE:-
protected
void
Button3Merge_Click(
object
sender, EventArgs e)
{
var downloadfolder = @
"E:\Desktop\XeroConnectData\Schema\All_22files\"
;
// download folder path
string
[] files = Directory.GetFiles(downloadfolder);
var masterfile =
new
XDocument();
XElement newDocument =
new
XElement(
"Invoice"
);
masterfile.Add(newDocument);
foreach
(var file
in
files)
{
Console.WriteLine(
"--------------------------------------------------"
);
Console.WriteLine(file);
Console.WriteLine(
"--------------------------------------------------"
);
XDocument xdoc = XDocument.Load(file);
masterfile.Root.Add(xdoc.Descendants(
"Invoice"
));
// root note
}
masterfile.Dump();
masterfile.Save(@
"E:\Desktop\XeroConnectData\merged_.xml"
);
}
Reply
Answers (
1
)
Inconsistent accessibility parameter:RestAPi in C#
relationship issue in another table