views:

125

answers:

2

Is there any limit for XML size for which XSLT is applied by XslCompiledTransform in .NET (3.5)? Also, is there any limitation for a length of parameteres passed to XSLT?

UPDATE: I have ment not the amount of parameters, but the length of a string, which is passed as a parameter and length of an XML text, to which XSLT is applied.

+1  A: 

As far as I know there aren't any hard limits on the amount of XML or the length of string parameters that can be processed by the XslCompiledTransform class.

However, applying an XSL transformation might potentially increase the memory consumption of your application considerably, depending on the amount of XML data being processed.

In some cases it may even go beyond the 2 GB limit imposed to 32-bit processes. If this situation should occur, the application might have to be compiled and run in 64-bit.

Enrico Campidoglio
Possibly, I wasn't clear enough when asking. I have ment not the amount of parameters, but the length of a string, which is passed as a parameter and length of an XML text, to which XSLT is applied.
brain_pusher
I am not aware of any hard limits imposed on the length of string parameters either. I updated my answer.
Enrico Campidoglio
+1  A: 

Is there any limit for XML size for which XSLT is applied by XslCompiledTransform in .NET (3.5)? Also, is there any limitation for a length of parameteres passed to XSLT?

No.

The memory consumption is usually overwhelmed by the size of the XML document. A somewhat course rule I have heard of is to multiply the size of the XML document by 5 and this would give you the approximate amount of RAM that might be necessary to hold that document in RAM.

So, a 2GB XML document has good chances of being processed on a 12GB RAM 64-bit machine.

Note, that there is no guarantee how long such processing may take -- just that it would be possible to hold such a document in memory.

Dimitre Novatchev