CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2006
    Posts
    2

    Question XML, where to start?

    Hey everyone, fist post here. Nice to meet you!

    I was wondering if anyone could point me in direction of a nice VB6 XML tutorial.

    I don't need to write XML, create nodes etc, I only need to be able to change a single tag with attributes to usable data.

    For instance:

    Code:
    <c type="chat" message="Pedro!: Girl, I wanna take you to a foo bar." />
    (The data's coming in through winsock).

    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: XML, where to start?

    Start with this:

    You might have to download the latest version of the MSXML Library. They were up to v4.0 last year.

    Code:
    Option Explicit
    ' Add a reference to Microsoft XML v?.0
    
    Private Sub Form_Load()
    GetHTML
    MsgBox GetHTML
    End Sub
    
    Private Function GetHTML() As String
    	Dim html As IXMLHTTPRequest
    	Set html = CreateObject("Microsoft.XMLHTTP")
    	With html
    		.Open "GET", "http://www.codeguru.com/forum/showthread.php?p=1506372#post1506372
    
    ", False
    		.send
    		GetHTML = .responseText
    	End With
    	Set html = Nothing
    End Function
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2006
    Posts
    2

    Re: XML, where to start?

    Hi, thanks for your help.

    I downloaded 6.0 just now. I added a referance and tried your code. It doesn't seem to like 'GetHTML' - gives me the error "the necessary data to complete this operation is not yet available".

    Any ideas?

  4. #4
    Join Date
    Sep 2006
    Posts
    635

    Re: XML, where to start?

    I only need to be able to change a single tag with attributes to usable data.
    then you can use
    Code:
    dim str_tag as string
    dim str_change
    str_tag="<"
    str_change="changed"
    rs_xml=replace(str_xml,str_tag,str_change)
    where str_xml take value <c type="chat" message="Pedro!: Girl, I wanna take you to a foo bar." />.

    str_tag= string to find.

    str_change= string to replace.

    rs_xml=changedc type="chat" message="Pedro!: Girl, I wanna take you to a foo bar." />.

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: XML, where to start?

    Probably a delay problem. Use F9-Break after the .Send statement, then wait a few seconds, and press F5 to continue. See what happens...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jul 2008
    Posts
    4

    Re: XML, where to start?

    Maybe you can find here about this:

    http://codervods.com/Default.aspx?mo...currentIndex=0

    it also has about xml

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

Featured