read XML

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

read XML

Post by link76 » Tue Aug 11, 2015 10:43 am

I would like to read all the nodes "​​title", present in the xml file,

Code: Select all

local list_title

on mouseUp
   get url "http://www.ansa.it/sito/notizie/cronaca/cronaca_rss.xml" 
   put revCreateXMLTree( it, true, true, false) into tRSS_ANSA
   
   repeat .....
      put revXMLNodeContents(tRSS_ANSA, "rss/channel/item/title") & return after list_title
   end repeat

   put list_title
   
end mouseUp
thanks

zaxos
Posts: 222
Joined: Thu May 23, 2013 11:15 pm

Re: read XML

Post by zaxos » Wed Aug 12, 2015 7:48 pm

According to the link you provided:

Code: Select all

   put the URL "http://www.ansa.it/sito/notizie/cronaca/cronaca_rss.xml" into tURL
   put revCreateXMLTree(tURL, false, true, false) into tTree 
   put revXMLChildNames(pTree, "rss/channel", return, "item", true) into tItems
   repeat for each line tLine in tItems
      put revXMLNodeContents(pTree, ("rss/channel/" & tLine & "/title") )&return after tTitles
   end repeat
put tTitles
I tested this and it worked, if you still cant figure it out i can send you the full code.
Knowledge is meant to be shared.

Post Reply