Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#892 .NET Null Reference in XSLT ResultDocumentHandler

v9.1
closed
Michael Kay
.NET API (34)
5
2012-10-08
2008-11-14
Michael Kay
No

When using IResultDocumentHandler with xsl:result-document you get a NullReferenceException if you return a TextWriterDestination as the result of the HandleResultDocument method.

The problem is caused by the fact that the code calls GetResult on the XmlDestination object twice, and with some kinds of XmlDestination, this returns a different object each time; when Close is called in the handler, the result object is then not recognized as one that has previously been returned by the Resolve() method.

A patch is in Subversion. This solves another (theoretical) problem at the same time: it is entirely possible for the HashCode of the result object to change as a result of changes to the content, so use of a Hashtable is not safe. The revised code therefore does a direct search in a list of result objects.

Discussion

  • Michael Kay
    Michael Kay
    2008-12-17

    Fixed in 9.1.0.5