mIRC Home    About    Download    Register    News    Help

Print Thread
#121735 31/05/05 05:43 PM
Joined: May 2005
Posts: 10
W
Winbots Offline OP
Pikka bird
OP Offline
Pikka bird
W
Joined: May 2005
Posts: 10
ok, I have a xml file, and I have a parser, but sometimes the xml is all on one line so that my parser cant understand it... I need a script that will turn this:
Code:
<tag><tag><tag><item><title>blah</title><link>blah</link><something>blah</something></item></tag></tag></tag>

into:
Code:
<tag>
<tag>
<tag>
<item>
<title>blah</title>
<link>blah</link>
<something>blah</something>
</item>
</tag>
</tag>
</tag>

the only thing that i really want is the <title>blah</title>, the <link>blah</link>, and the </item>, and there can be many or few <tag>'s and </tag>'s and there can be lots of <item> ... </item> after each other... smile

#121736 31/05/05 06:35 PM
Joined: Feb 2005
Posts: 74
S
Babel fish
Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
There is a mIRC script forum, not xml .. wink)~


[color:red]m[color:blue]IRC[color:green] for EvEr

#121737 31/05/05 07:32 PM
Joined: May 2005
Posts: 10
W
Winbots Offline OP
Pikka bird
OP Offline
Pikka bird
W
Joined: May 2005
Posts: 10
I want a mirc script to parse it...

#121738 31/05/05 09:48 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
have you tried Janno's XML parser dll found on mircscripts.org ?


$maybe
#121739 01/06/05 12:18 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Don't know if it's any use to you, but it does show the XML in the way you wanted it.


  • alias parse {
    var %a, %b = $regsub($1-,/(?<=>)(?=\s*<)/g,$lf,%a)
    tokenize 10 %a
    echo -a $*
    }


Gone.
#121740 01/06/05 01:20 AM
Joined: May 2005
Posts: 10
W
Winbots Offline OP
Pikka bird
OP Offline
Pikka bird
W
Joined: May 2005
Posts: 10
Thanks, works great.... until I try to parse a 6.44 kb file... any way to make that work too?

#121741 01/06/05 08:03 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Maybe this is of any help ?


$maybe
#121742 01/06/05 09:57 PM
Joined: May 2005
Posts: 10
W
Winbots Offline OP
Pikka bird
OP Offline
Pikka bird
W
Joined: May 2005
Posts: 10
fixed... used fiber optic's regex


Link Copied to Clipboard