+ Reply to Thread
Results 1 to 6 of 6

Thread: Help parsing XML files using VB

  Share/Bookmark
  1. #1

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    3,201
    Thank Post
    460
    Thanked 232 Times in 195 Posts
    Rep Power
    67

    Default 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; 09-06-2009 at 07:54 AM.

  2. #2

    Reputation Reputation Reputation
    monkeyx's Avatar
    Join Date
    Nov 2006
    Posts
    352
    Thank Post
    8
    Thanked 48 Times in 37 Posts
    Rep Power
    17

    Default

    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

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,146
    Thank Post
    133
    Thanked 185 Times in 71 Posts
    Rep Power
    43

  4. #4

    Reputation Reputation Reputation Reputation Reputation Reputation
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    728
    Thank Post
    18
    Thanked 92 Times in 80 Posts
    Rep Power
    23

    Default

    XML Developer Center

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

  5. #5

    Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation Reputation
    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    3,201
    Thank Post
    460
    Thanked 232 Times in 195 Posts
    Rep Power
    67

    Default

    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

    Reputation Reputation Reputation Reputation Reputation Reputation
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    728
    Thank Post
    18
    Thanked 92 Times in 80 Posts
    Rep Power
    23

    Default

    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!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

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

Posting Permissions

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