'(declarations) Dim httpobj As Variant Dim source As Variant, style As Variant 'Terminate Set httpobj = Nothing Set source = Nothing Set style = Nothing Function getHTML(url As String) As String 'returns string as HTML On Error Goto err_ If Datatype ( httpobj ) = 0 Then 'ikke initialisert Set httpobj = CreateObject("WinHTTP.WinHTTPRequest.5.1") End If Call httpobj.Open("GET", url,False) ' Send the HTTP Request. Call httpobj.Send getHTML = httpobj.ResponseText Exit Function err_: getHTML = "Error: " + Error + ", line " + Cstr(Erl) End Function Function transformXML( login As String, xml As String, xsl As String) As String On Error Goto err_ 'avoid creating the object for every function-call If Datatype ( source ) = 0 Then 'ikke initialisert Set source = CreateObject( "Microsoft.XMLDOM" ) source.async = False End If 'avoid creating the object for every function-call If Datatype ( style ) = 0 Then 'ikke initialisert Set style = CreateObject( "Microsoft.XMLDOM" ) style.async = False 'load xslt for the first time style.load( xsl ) Else 'only load xslt when needed If xsl <> "" Then 'load XSL template style.load( xsl ) End If End If 'you only need to login once per agent / source If login <> "" Then 'login source.load( login ) End If 'load XML source.load( xml ) If Not(source.parseError.errorCode = 0) Then Error source.parseError.errorCode , source.parseError.reason Else 'transform source transformXML = source.transformNode( style ) End If Exit Function err_: transformXML = "Error: " + Error + ", on line" + Cstr(Erl) End Function