Results 1 to 3 of 3

Thread: Need help parsing an xml file from a webserver that has been zipped (gz)

  1. #1

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    34

    Question Need help parsing an xml file from a webserver that has been zipped (gz)

    I am able to parse a regular xml file that is not compressed using the XDocument..XElement etc. What I need to be able to do is have my application access an XML file that has been compressed (gzip) on a web server and parse it.

    Is there a way to decompress the gz file and use my regular xml parsing process on the fly without the user having to actually download the file manually? Currently, this is what I'm using to parse the xml files..

    Code:
    Dim resourceList As XDocument = XDocument.Load("resources.xml")
            For Each resource As XElement In resourceList...<resource>
                Dim supplyName As String = resource.Element("supplies")
                Dim hoursNumber As String = resource.Element("hours")
                Dim item As New ListViewItem(supplyName)
                item.SubItems.Add(hoursNumber)
                ListView1.Items.Add(item)
     
            Next
    This adds all items to a listview (though, I will most likely go with combo boxes later) but I can not figure out how to pull the resources.xml.gz file and parse it from the application.

    Thanks in advance for any and all help.

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Need help parsing an xml file from a webserver that has been zipped (gz)

    If the server has a compression program built in and you can access it with the appropriate permissions (and manipulate it in VB) it may be possible but that's something you'll need to take up with whoever runs the server. Whatever the result of that, downloading the file is always going to be the easier option!

  3. #3
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: Need help parsing an xml file from a webserver that has been zipped (gz)

    This pattern in common to all great programmers I know: they're not experts in something as much as experts in becoming experts in something.

    The best programming advice I ever got was to spend my entire career becoming educable. And I suggest you do the same.

Posting Permissions

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



Click Here to Expand Forum to Full Width