« NvdlValidatingReader | Main | .NET developers want inconsistent schema validity on xml:* attributes? »
XsltSettings.EnableDocumentFunction
This is a short followup for XslCompiledTransform. It accepts a new optional argument XsltSettings. It is an enum that holds two switches:
- EnableDocumentFunction
- EnableScript
There is a reason why document("") could be optional. When document() function receives an empty string argument, it returns a node-set that contains the stylesheet itself. That however means, XSLT engine must preserve reference to the input stylesheet document (XPathNavigator). There was a bug report to MS feedback that document() could not be resolved (I once refered to it). So this options looks like Microsoft's response to developers' need.
I thought that not keeping source document is a good idea, so I tried to remove all the references to XPathNavigator clones in our XslTransform (except for document() function). After some hacking, I wrote a simple test which assures that XslTransform does not have reference to the document:
So I tried it under Windows:
$ csc test.cs /nologo /nowarn:618 $ mono test.exe load : False transform : False $ ./test load : True transform : False
Hmm... I wonder if I missed something.