|
-
Dec 27th, 2021, 05:32 AM
#21
Thread Starter
Member
Re: Reading an xml file in vb6.0
 Originally Posted by baka
that is why u should follow my example.
this because u learn more that way.
if you use the other methods, u will never learn the details.
and since you need to learn "a lot" you should start there, like everybody else started.
usually when I put examples its ignored, because the most experienced members here gives u "smarter" examples,
but in the same time they don't teach u as much. and thats is what Im always trying to do. but most of the time, if not always its ignored because "it require u to work for it"
so stop trying to learn by using expert methods, and start from scratch with basic functions like:
InStr
Mid$
Len/LenB
Asc/AscW
Chr/ChrW
Line Input
StrConv
and all other basic functions that should be "primary" to learn FIRST.
Do you mean to use the following code that you have sent to me?
I have learned the functions that you have sent to me.
Will xml$ contains the different values every time I get the REST API response after sending data to the API?
In your code I see that it contains the values as I have sent them to you.
Which code should I add in module1.bas" ? The code from xmlMono2 that you have sent to me?
In your example, I don't understand why do you use the Replace, is it possible to explain it to me please?
Re: Reading an xml file in vb6.0
use this code https://www.vbforums.com/attachment....1&d=1605384509
(from this post https://www.vbforums.com/showthread....=1#post5499679)
Add in module1.bas this code
and in immediate mode execute Test2
Code:
Sub Test2()
Dim xml$
xml$ = Replace("<?xml version='1.0' encoding='utf-8'?><Country xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><city><index>1</index><StreetName>Street name AAAAAAAAA</StreetName><StreetNumber>1050</StreetNumber><status>Success</status></city><city><index>2</index><StreetName>Street name BBBBBB</StreetName><StreetNumber>1051</StreetNumber><status>Success</status></city></Country>", "'", Chr$(34))
Dim xmldata As New XmlMono2, c As Collection, child As XmlMono2
xmldata.xml(xmldata) = xml$
Set c = xmldata.GetListByTag("city")
For Each child In c
Debug.Print child.textFromChild("StreetName")
Debug.Print child.textFromChild("index")
Next
End Sub
Tags for this Thread
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
|