Results 1 to 14 of 14

Thread: VB - XML Newbie

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Location
    Worcester, England
    Posts
    24

    VB - XML Newbie

    I don't know the best way of getting started in processing XML messages using VB... can anyone suggest a good starting point - tools needed - further reading etc.. so I can hit the ground running

    thanks
    Rob

  2. #2
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    Look up the Instr() and Mid() functions. Instr() finds where data is in a string, and Mid() will take data out of a string no matter where it is.

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Isn't there an XML parsing component? Or am I imagining it? Not sure. Or is this a VB Script question?

    *ponders whether or not he should hit submit* ...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Location
    Worcester, England
    Posts
    24
    Writing my own XML parser seems a little heavy handed - I thought a XML parsing component would be readily available to do the job for me so that I could focus effort on the application development itself.
    Getting data into XML format from a recordset doesnt seem to be much of an issue... its the otherway that seems to cause all the bother.. I shall keep looking...
    Rob

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Perhaps you should ask this in a VB forum?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    GROAN....

    For some reason I have this feeling that the people who have replied thus far haven't really gotten in to VB & XML much, if at all....
    Yes, writing a parser is a bit much....
    Yes, there is a "pre-built" parser component....there's several.... Microsoft has one..... called MSXML (search MSDN for it)
    As far as "getting started" with XML... it kinda depends on what you want to do with it.

    RobC - contact me off line -- I might be of more use that way than inside this tiny box.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    You should use MSXML. It is essentially a new language and while it may take a while to get used to, it will be worth the effort as compared to trying to read/write XML using VB's string functions. It's a pretty big subject so you should probably buy a book. If you have specific questions I or other people can help you.

  8. #8
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    http://www.juicystudio.com/tutorial/vb/xml.html

    This tut should get you started using MSXML and the DomDocument.
    Despite all the hype remember that at the end of the day XML is just a glorified text file, and unless you have a very definite reason for using it your going to find it rather boring.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Originally posted by MartinLiss
    You should use MSXML. It is essentially a new language and while it may take a while to get used to, it will be worth the effort as compared to trying to read/write XML using VB's string functions. It's a pretty big subject so you should probably buy a book. If you have specific questions I or other people can help you.
    *scratches head*
    MSXML a new language? A big subject?
    Or do you mean XML itself?

    Even XML is not that big. I have a book on XML (I regret buying it, it's outdated and doesn't contain much useful information) and only about a third or even less is about core XML (XML syntax, common attributes like xml:lang and xml:whitespace or however it's called, DTDs), the rest is about XML Schema, XHTML, MathML, XHTML, SVG, XSL etc. Parts are even about CSS or project planning and internationalization!
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

  11. #11
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: GROAN....

    Originally posted by techgnome
    For some reason I have this feeling that the people who have replied thus far haven't really gotten in to VB & XML much, if at all....
    Well nobody else seemed to jump to help him. Forgive me for trying to give him some kind of help.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  12. #12
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Originally posted by MartinLiss
    I guess I mean the language you need to learn when you use the DOM.

    Sounds like a poor book.
    But the DOM can be used from any language.


    Yeah, the book IS poor. As I said, I regret buying it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jan 2002
    Location
    Worcester, England
    Posts
    24
    I have picked up the MSXML SDK.. and will have a look at it... as for books I personally find a lot of them turn XML into a heavy subject and well beyond anything I will be using it for...
    Once I have the basic paser working then I can then let it evolve and my understanding improves.

    Coding your own parser whilst learning the fundimentals of XML etc would be a mis-direction of effort, and would lead to a disheartening death spiral of confussion and rework... at which point I would welcome back the CSV!

    Rob

  14. #14
    New Member
    Join Date
    Jun 2003
    Location
    Pensacola, Florida, USA
    Posts
    7
    Rob...I'm in the same boat.

    I just got the MSXML SDK 4.0 also and I have been reading through it.

    I understand XML docs and schemas, but I need to know how to author an XML document in VB using a given schema. In other words, I don't want to have to print out the schema and manually write out the XML file. I know there has to be a way load a schema in VB and then use DOM to write out data by passing it element names. At least I hope I can do that. Let me know if you run across any documentation on this.

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