itais SAX parser

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

Post Reply
Flake
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Mar 18, 2017 8:04 am

itais SAX parser

Post by Flake » Sun Mar 19, 2017 8:27 am

Hey, everybody!
I'm pretty new to this forum, so let me introduce myself with a script that I completed just recently :D
It's a general-purpose and highly-extensible-and-flexible event-based markup parser. I've been working on this since about 4 days, and it was very difficult to make, but is finally done! I made this because I needed it in a CMSF project that I'm working on.

Here's the link: https://www.solidfiles.com/v/k3RKypwDmrqMB (a copy of the license, CLNS, can be found in License.txt)

Here's a simple example:

Code: Select all

$parser = new iSAXParser("[@[command]]", "[/]");
$parser->Load("[color]This is red text[/] And this is plain text");
echo($parser->Parse(function ($command, $body)
{
    if ($command == "color") return "<span style=\"color:red\">$body</span>";
    else return $body;
}));
Unfortunately, I haven't quite completed it, so the validator isn't done, and inline tags aren't done either. If you feel like helping, you can edit it and post it here.
You can see all of the available functions in the parser.php file.
Last edited by Flake on Wed Mar 22, 2017 3:51 am, edited 1 time in total.

hyper
php-forum Active User
php-forum Active User
Posts: 270
Joined: Mon Feb 22, 2016 5:52 pm

Re: itais SAX parser

Post by hyper » Mon Mar 20, 2017 3:57 pm

That looks more complicated than trying to read through a mirror with lipstick all over it :?

Flake
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Mar 18, 2017 8:04 am

Re: itais SAX parser

Post by Flake » Wed Mar 22, 2017 3:32 am

hyper wrote:
Mon Mar 20, 2017 3:57 pm
That looks more complicated than trying to read through a mirror with lipstick all over it :?
That's bad luck for you, since my new code (which I haven't posted here yet) is even more complicated and about 50 more lines :D

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest