Hello: What is the fastest way to parse out these XML tags from some futures price data?
<Date>11/3/2010</Date>
<Open>1197.5</Open>
<High>1198</High>
<Low>1196</Low>
<Last>1197.25</Last>
<Settle>1197.25</Settle>
<Volume>2361808</Volume>
<OpenInterest>2683550</OpenInterest>
It would be cool if you could set the itemdelimiter to an entire string rather than just one character - like in this case, if I could set the item delimiter to <anything>, then just replace all the item delimiters with ","'s
parsing the tags out of an XML file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: parsing the tags out of an XML file
adventuresofgreg,
Let's assume that fld 2 contains your XML...
Kind regards,
Mark
Let's assume that fld 2 contains your XML...
Code: Select all
on mouseUp
put "<p>" & fld 2 & "</p>" into myHtml
replace cr with "</p><p>" in myHtml
set the htmlText of fld 1 to myHtml
end mouseUp
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 349
- Joined: Tue Oct 28, 2008 1:23 am
- Contact:
Re: parsing the tags out of an XML file
wow - thanks Mark! That's so simple - and fast. Now I just have to try to understand it... I'll look up htmlText. I want to convert each date of prices to the standard:
date,prices,return
date, prices, return
etc...
date,prices,return
date, prices, return
etc...
Mark wrote:adventuresofgreg,
Let's assume that fld 2 contains your XML...
Kind regards,Code: Select all
on mouseUp put "<p>" & fld 2 & "</p>" into myHtml replace cr with "</p><p>" in myHtml set the htmlText of fld 1 to myHtml end mouseUp
Mark
Re: parsing the tags out of an XML file
Hi Greg,
looks like you need to dive a bit deeper into XML
Of course you could do some chunk stuff within a repeat loop,
but to be prepared for the future you should take the dive!
Please check the wonderful stack "xmldemo1" on this site:
http://www.troz.net/rev/
This got me started with XML, too!
Best
Klaus
looks like you need to dive a bit deeper into XML

Of course you could do some chunk stuff within a repeat loop,
but to be prepared for the future you should take the dive!
Please check the wonderful stack "xmldemo1" on this site:
http://www.troz.net/rev/
This got me started with XML, too!
Best
Klaus