+ Post New Thread
Results 1 to 6 of 6
Coding Thread, Help parsing XML files using VB in Coding and Web Development; or any other language producing standalone exe I want to make a prog to parse a bunch of xml files ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,829
    Thank Post
    1,476
    Thanked 595 Times in 446 Posts
    Rep Power
    170

    Help parsing XML files using VB

    or any other language producing standalone exe

    I want to make a prog to parse a bunch of xml files looking for a field and then change the value of that field.

    Im completely stuck at the beginning just trying to use VB 2008 express to just read one simple XML file

    Every single example I can find gives me an exception so I must be missing something "basic"

    Help (from VB experts or anyone else using a free prog)

    regards

    Simon
    Last edited by SimpleSi; 9th June 2009 at 08:54 AM.

  2. #2
    monkeyx's Avatar
    Join Date
    Nov 2006
    Posts
    365
    Thank Post
    8
    Thanked 52 Times in 41 Posts
    Rep Power
    26
    Hi,

    I have used the following quite a bit

    CodeProject: Quick and Dirty Settings Persistence with XML. Free source code and programming help

    This is a more complete parsing article.

    CodeProject: XMLite: simple XML parser.. Free source code and programming help

    Not done much with vb.net, but you could use sharpcode to convert the c# to vb.net

    Regards,

    Tim

  3. #3
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63

  4. #4
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,361
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    61
    XML Developer Center

    Check the MSDN refs, there is a .NET class for interpreting XML.

  5. #5

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,829
    Thank Post
    1,476
    Thanked 595 Times in 446 Posts
    Rep Power
    170
    Thanks for all the suggestions - I've found my problem!

    I was using wordpad to save example xml files (I use it all the time to edit my real xml files) to read back in.

    Of course, it defaults to saving as type rtf so the xml files were completely mal-formed

    Found this out by just reading them back in one byte at a time

    regards

    Simon

  6. #6
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,361
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    61
    ah that would do it!! Try looking at Notepad++ for an alternative to that, it will format the files properly and make the code much easier to read!!



SHARE:
+ Post New Thread

Similar Threads

  1. XML - Formatting confusion
    By steele_uk in forum How do you do....it?
    Replies: 5
    Last Post: 26th January 2009, 10:11 PM
  2. Flash Slideshow (.xml)
    By danIT in forum General Chat
    Replies: 7
    Last Post: 7th May 2008, 01:40 PM
  3. Search replace across multiple XML files
    By ajbritton in forum Windows
    Replies: 6
    Last Post: 7th April 2008, 12:07 AM
  4. WDSClietUnattended.xml
    By ICTNUT in forum How do you do....it?
    Replies: 4
    Last Post: 17th January 2008, 10:17 AM
  5. Any XML gurus?
    By TechMonkey in forum Web Development
    Replies: 4
    Last Post: 2nd February 2007, 01:40 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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