I have some very large XML files (800 MB to 1.5 GB). I need to apply XSLT on that. I am able to read it XMLTextReader. When i applied XSLT transformation, get SystemOutOfMemory Exception.
My code looks like;
static void Main(string[] args)
{
XDocument newTree = new XDocument();
XmlTextReader oReader = new XmlTextReader(@"C:\Projects\myxml.xml");
using (XmlWriter writer = newTree.CreateWriter())
{
XslCompiledTransform oTransform = new XslCompiledTransform();
oTransform.Load(@"C:\Projects\myXSLT.xsl");
oTransform.Transform(oReader, writer);
}
Console.WriteLine(newTree);
}
Can anyone help me here?
Thanks in advance. It is very urgent. If I don't get any solution, I need to split XML into smaller XML and do transformation.