Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  2. ' This function assumes url that will return
  3. ' xml as a response and return this string
  4. ' clear from bom in begining (if BOM is present).
  5. ' @author Georgi Naumov
  6. ' gonaumov@gmail.com for contacts and suggestions.
  7. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  8. Function getXmlResponseClearFromBom(strUrl)
  9. Dim httpRequest, regEx
  10. Set regEx = New RegExp
  11. regEx.Pattern = "^[^<]+"
  12. regEx.IgnoreCase = True
  13. regEx.Global = True
  14. Set httpRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
  15. httpRequest.Open "GET", strUrl, true
  16. httpRequest.Send()
  17. httpRequest.WaitForResponse()
  18. getXmlResponseClearFromBom = regEx.Replace(httpRequest.ResponseText,"")
  19. End Function