We are using XSLT to generate reports of our data. The data is currently stored in Oracle as XML documents (not using the XML type, but normal CLOB). We select the right XML documents and create a single document:
<DATABASE>
<XMLDOCUMENT> ... </XMLDOCUMENT>
<XMLDOCUMENT> ... </XMLDOCUMENT>
...
</DATABASE>
In some cases, the complete XML document contains +100000 documents. This means that a huge XML document is loaded first into memory, causing all kinds of memory issues.
How can we prevent this from happening? We are using the XslCompiledTransform class in .NET 2.0.
I know that there are 2 forms of parsing XML documents: DOM and SAX. But as I understand this, the SAX way is not possible in combination with XSLT. The DOM parsing method forces us to load the entire thing into memory.
What are our options? Does it help to first write the complete document to disk? Does Oracle perform a better job on large XSLT transformations?