Answer the question
In order to leave comments, you need to log in
How to process html characters in the resulting xml document?
Good evening!
I have such a situation that I get a huge xml file and split it into several small files. The source file is a huge number of elements <organization>...</organization>
, and I make each such element a separate file.
So that the application does not fall from processing such an amount of data, I use the XmlReader class.
Source:
using (XmlReader reader = XmlReader.Create(xmlFile))
{
XElement organization = null;
string exportPath = @"C:\Export..";
reader.MoveToContent();
while (!reader.EOF)
{
if (reader.NodeType == XmlNodeType.Element && reader.Name == "organization")
{
organization = XElement.ReadFrom(reader) as XElement;
string xmlInside = organization.ToString();
....
}
else
{
reader.Read();
}
}
}
organization = XElement.ReadFrom(reader) as XElement;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question