Advertisement
zono

clear from bom in begining

Mar 4th, 2012
1,897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement