+ Reply to Thread
Results 1 to 4 of 4

Adding encoding type when importing XML from URL

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    5

    Adding encoding type when importing XML from URL

    Hi All,
    I am trying to import XML files that don't specify the encoding type in the header. The XML's can be imported correctly when the encoding attribute is set to ISO-8859-1, but without it I get errors that shut me down as soon as an unfamiliar character is found.

    Unfortunately, there's nothing I can do to change the way the XML's are formed, and changing each of the XML's manually is impractical. I'm hoping to find a way to change the way Excel reads the XML, either as a Excel setting or with VBA. Failing that, I need a way to download the XML's from URL's, change them, and import them with limited (or no) action needed from the user.

    Any ideas?

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Adding encoding type when importing XML from URL

    Have a look at/search for XMLhttp and its SetRequestHeader method.

  3. #3
    Registered User
    Join Date
    04-03-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Adding encoding type when importing XML from URL

    Thanks! I'll give it a look.

  4. #4
    Registered User
    Join Date
    04-03-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Adding encoding type when importing XML from URL

    Here's an update (still no solution).

    I've been trying various interfaces to get the XML data, including XMLHTTP, XMLHTTPRequest, and WinHTTP, but now I can't get through authentication. I have tried adding username and password to the appropriate .open "GET" requests, but it doesn't work, nor does .SetCredentials with WinHTTP. I have received an XML that tells me I failed authentication, and I can read it but I don't know if that means my encoding troubles are over, as the XML doesn't contain the problematic characters. Using these other methods has been a great learning experience, but I don't think the API allows them. That or I'm doing something wrong... which isn't too unlikely. I suspect AJAX is preferred, that or some kind of Forms Authentication.... In any case, I'm still in over my head. I would really appreciate any more advice anyone has for this situation.
    Last edited by L-Hype; 04-09-2012 at 09:27 PM. Reason: Typo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1