So for a while I've been using XslCompiledTransform because that's what Microsoft tells me I need to use as XslTransform is deprecated. Recently I had to use it with a transform that has nearly 100,000 lines (generated xsl - of course). When I used my application I was shocked to see an OOM pop up. No matter what I did - OOM is all I get... For giggles I went back to XslTransform... Same exact code changing XslCompiledTransform to XslTransform and it works fine...
Can anyone tell me how to work around the OOM - is there some 'swtich' on XslCompiledTransform? I don't know how you will be able to replicate the exact problem, but if anyone has any answers they're much appreciated.
Thanks - code below:
Works:
XslTransform myXslTransform = new XslTransform();
myXslTransform.Load(xslWith100ThousandLines);
MemoryStream m = new MemoryStream();
myXslTransform.Transform(myXPathDocument, null, m);
m.Flush();
m.Close();
Fails with OOM
XslCompiledTransform cxslt = new XslCompiledTransform();
cxslt.Load(xslWith100ThousandLines);
MemoryStream m = new MemoryStream();
cxslt.Transform(myXPathDocument, null, m);
m.Flush();
m.Close();