|
Joined: Mar 2006
Posts: 3
Self-satisified door
|
OP
Self-satisified door
Joined: Mar 2006
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
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
I think something like this could work well: $xml(file,level1,level2,level3) This would get data from <level1><level2><level3>data</level3></level2></level1> $xml(file,level1,level2,level3,attrib).attribute This would get data from <level1><level2><level3 attrib="data" /></level2></level1>
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
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
|
|
|
|
Joined: Dec 2002
Posts: 19
Pikka bird
|
Pikka bird
Joined: Dec 2002
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).
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
*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.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You are right. You used to think of it as an MSN client.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
That it's more than just a text based program. It's ful of funny faces, and pretty colors and all that good [censored].
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
I never had smileys OR pretty colours when I used it for that, but again, that's irrelevant to the thread.
|
|
|
|
Joined: Dec 2002
Posts: 19
Pikka bird
|
Pikka bird
Joined: Dec 2002
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...
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
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
|
|
|
|
|