i'd creare simple parser in java analize string containing html , replace custom tags , if else/elseif statements, similar mailchimp.
actually replace custom tags example: *|name|*
name of recipient, *|age|*
whith age of recipient , on.
i'd add conditional statements permit expressions like:
<html> <head>....</head> <body> *|if:gender=m|* hello mr.<b>*|name|*</b> *|elseif:gender=f|* hello mrs.<i>*|name|*</i> *|else:|* dear customer *|end:if|* <p>bla bla bla</p> .... .... </body> </html>
in short, similar sintax mailchimp one. user can write own html , add custom syntax customize content based on data.
i think i'm able create code works i'm searching best practice implement it. looking way follow implements code.
would nice if parser can manage nested if/elseif/else statements.
Comments
Post a Comment