mIRC Home    About    Download    Register    News    Help

Topic Options
#146118 - 31/03/06 01:53 PM XML Support
Enriad Offline
Self-satisified door

Registered: 30/03/06
Posts: 3
Hi,

I'm sure there are scripts out there, though wouldn't it be neat if there was $xml(file/url).

Possibly props like $xml(file, line).type which returns element, header, etc?

Have like /xml file type line for writing them.

I'm not sure, just some ideas, you guys could probably think of something better.

Daniel

Top
#146119 - 26/04/06 05:20 PM Re: XML Support
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
I think something like this could work well:

Code:
$xml(file,level1,level2,level3)


This would get data from <level1><level2><level3>data</level3></level2></level1>

Code:
$xml(file,level1,level2,level3,attrib).attribute


This would get data from <level1><level2><level3 attrib="data" /></level2></level1>

Top
#146120 - 27/04/06 08:25 AM Re: XML Support
Mpdreamz Offline
Hoopy frood

Registered: 27/04/04
Posts: 759
Loc: Arnhem, The Netherlands
adding to your method

$xml(file,level1,level2,level3,N).childnode returns total childnodes for N = 0 or the Nth.

$xml(file,level1).treelength returns the "childnode deepness" so if level1 is formatted like this

level1
-level2
--level3
---level4
---/level4
--/level3
-/level2
/level1


it returns 3 because level 4 is the deepest nested node and is 3 levels down.

Im sure theres loads more cool properties we can think off.
It would be a really nice feature
_________________________
$maybe

Top
#146121 - 06/05/06 01:50 AM Re: XML Support
MiSsInGnO Offline
Pikka bird

Registered: 29/12/02
Posts: 19
While I agree this feature would be great (currently I made a script which parses XML files using multi-dimensionnal arrays made of a hashtable), you should keep in mind that mIRC was intended for chatting.

So, if you'd like to parse XML files, you should probably do it yourself, use some workarounds (I've already seen implementations based on Windows' XML parser with $com calls), or use a MORE EFFICIENT language (a compiled one like C for example).

Top
#146122 - 06/05/06 02:39 AM Re: XML Support
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
*sigh* I'm not going to debate this AGAIN, but I'll just say that mIRC has long been more than JUST a chat program. MANY of mIRC's features are NOT chat related.

Top
#146123 - 06/05/06 08:21 AM Re: XML Support
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
You are right. You used to think of it as an MSN client.

Top
#146124 - 06/05/06 08:54 AM Re: XML Support
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
How is that relevant?

Top
#146125 - 06/05/06 08:59 AM Re: XML Support
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
That it's more than just a text based program. It's ful of funny faces, and pretty colors and all that good [censored].

Top
#146126 - 06/05/06 09:04 AM Re: XML Support
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
I never had smileys OR pretty colours when I used it for that, but again, that's irrelevant to the thread.

Top
#146127 - 06/05/06 10:39 AM Re: XML Support
MiSsInGnO Offline
Pikka bird

Registered: 29/12/02
Posts: 19
Well, from a developper's point of view, adding XML support to an application such as mIRC isn't an easy thing IMHO.
Of course there are many libraries that let you parse XML files (such as libxml under Linux), but adding support for it through a scripting language is another completely different task...

Top
#146128 - 06/05/06 05:23 PM Re: XML Support
Mpdreamz Offline
Hoopy frood

Registered: 27/04/04
Posts: 759
Loc: Arnhem, The Netherlands
mIRC Script is not just for Chat related functions, i know off alot of people that hardly chat but still use mIRC Scripts to quickly script a program.
The "It's not related to chat so therefor it shouldn't be added" arguement has long cease to exist. Your jumping to the conclusion in that mIRC is slow perse. Just yesterday i needed to quickly build up an xml from a 700kb plain txt file it took 1 second using a filter some regex matching and some file handling commands. If this is in plain mIRC Script then using a built in xml method should be even faster, though granted that building xml files is not quite the same as parsing them.

If we think outside the box who knows where we'll end up but i can assure you the road leading to the end will be alot more fun if we do.
_________________________
$maybe

Top