Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XML parser
#1
before i try to invent the wheel again,
do you have an example for parsing a xml file ?
my idea is to build a small newsreader for checking the forum for new articles.
pi
#2
Code:
Copy      Help
typelib MSXML {D63E0CE2-A0A2-11D0-9C02-00C04FC99C8E} 2.0
#err 1
typelib MSXML {F5078F18-C551-11D3-89B9-0000F81FE221} 3.0

type QMFORUMRSSITEM str'title str'url str'text
ARRAY(QMFORUMRSSITEM) a

MSXML.XMLDocument xd._create
xd.url="http://www.quickmacros.com/forum/rss.php"
MSXML.IXMLElement e1 e2 e3
e1=xd.root.children.item("CHANNEL")
foreach e2 e1.children
,str tag=e2.tagName
,if(tag~"ITEM"=0) continue
,QMFORUMRSSITEM& r=a[a.redim(-1)]
,e3=e2.children.item("TITLE")
,r.title=e3.text
,e3=e2.children.item("LINK")
,r.url=e3.text
,e3=e2.children.item("DESCRIPTION")
,r.text=e3.text

;now all is in array, and you know what to do with it
int i
for i 0 a.len
,ShowText a[i].title a[i].text
#3
BIG WOW !!!

thanks !
pi
#4
care to share once you come up with something?
An old blog on QM coding and automation.

The Macro Hook
#5
yep, for sure.
pi
#6
On Vista there is no ver 2 XML dll. I updated the code to use ver 3 on error.
#7

_pi

Did you ever finish this, or get a beta ?
#8
currently i work on a blog client (xml-rpc) for drupal cms.

i think a beta will be available next week.
first i have to finish setting up my new page.
pi
#9

Sounds great, Good Luck on your page.
#10
Gintaras Wrote:
Code:
Copy      Help
typelib MSXML {D63E0CE2-A0A2-11D0-9C02-00C04FC99C8E} 2.0
#err 1
typelib MSXML {F5078F18-C551-11D3-89B9-0000F81FE221} 3.0

which one do i have to register in window 7?
pi
#11
Probably 3. On Vista I have 3, 4, 5 and 6.


Forum Jump:


Users browsing this thread: 1 Guest(s)