mIRC Homepage

XML Support

Posted By: Enriad

XML Support - 31/03/06 12:53 PM

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
Posted By: hixxy

Re: XML Support - 26/04/06 04:20 PM

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>
Posted By: Mpdreamz

Re: XML Support - 27/04/06 07:25 AM

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
Posted By: MiSsInGnO

Re: XML Support - 06/05/06 12:50 AM

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).
Posted By: hixxy

Re: XML Support - 06/05/06 01:39 AM

*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.
Posted By: SladeKraven

Re: XML Support - 06/05/06 07:21 AM

You are right. You used to think of it as an MSN client.
Posted By: hixxy

Re: XML Support - 06/05/06 07:54 AM

How is that relevant?
Posted By: SladeKraven

Re: XML Support - 06/05/06 07:59 AM

That it's more than just a text based program. It's ful of funny faces, and pretty colors and all that good [censored].
Posted By: hixxy

Re: XML Support - 06/05/06 08:04 AM

I never had smileys OR pretty colours when I used it for that, but again, that's irrelevant to the thread.
Posted By: MiSsInGnO

Re: XML Support - 06/05/06 09:39 AM

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...
Posted By: Mpdreamz

Re: XML Support - 06/05/06 04:23 PM

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.
© 2022 mIRC Discussion Forums