mIRC Homepage
Posted By: Winbots Help formatting a file - 31/05/05 05:43 PM
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
Posted By: SkyD Re: Help formatting a file - 31/05/05 06:35 PM
There is a mIRC script forum, not xml .. wink)~
Posted By: Winbots Re: Help formatting a file - 31/05/05 07:32 PM
I want a mirc script to parse it...
Posted By: Mpdreamz Re: Help formatting a file - 31/05/05 09:48 PM
have you tried Janno's XML parser dll found on mircscripts.org ?
Posted By: FiberOPtics Re: Help formatting a file - 01/06/05 12:18 AM
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 $*
    }
Posted By: Winbots Re: Help formatting a file - 01/06/05 01:20 AM
Thanks, works great.... until I try to parse a 6.44 kb file... any way to make that work too?
Posted By: Mpdreamz Re: Help formatting a file - 01/06/05 08:03 AM
Maybe this is of any help ?
Posted By: Winbots Re: Help formatting a file - 01/06/05 09:57 PM
fixed... used fiber optic's regex
© mIRC Discussion Forums