All pastes #953803 Raw Edit

Vermischtes

public text v1 · immutable
#953803 ·published 2008-03-23 11:19 UTC
rendered paste body
'loading
    Public Function Transfer() As HtmlDocument
        Dim sbResult As New StringBuilder
        Dim ctTransfer As New XslCompiledTransform
        Dim htmlReturn As HtmlDocument

        Using swHelper As New StringWriter(sbResult), wbContent As New WebBrowser
            ctTransfer.Load("blabla.xslt", Nothing, New XmlUrlResolver)
            ctTransfer.Transform("blublub.xml", Nothing, swHelper)
            wbContent.DocumentText = sbResult.ToString
            htmlReturn = wbContent.Document
            If IsNothing(wbContent.Document) Then MsgBox("hi") '<-- not triggered
        End Using

        Return htmlReturn
    End Function

'display
        Dim y As HtmlDocument = x.Transfer()
        If IsNothing(y.Body) Then MsgBox("hi") '<-- is being triggered
        MsgBox(y.Body) '<-- therefore this raises an exception