-
December 17th, 2006, 04:31 PM
#1
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
-
December 17th, 2006, 05:01 PM
#2
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
-
December 17th, 2006, 05:48 PM
#3
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?
-
December 17th, 2006, 06:01 PM
#4
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." />.
-
December 18th, 2006, 12:00 AM
#5
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...
-
July 11th, 2008, 07:14 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|