dynamic HTML with Prolog

Saturday, July 5, 2014

This is my first question here, so please excuse mistakes.


I want to generate dynamic html from a list in prolog. For each question I want to generate a p-tag with this question.


question(1, 'First Question'). question(2, 'Second Question').


get_quest( Q ) :- question( _, Q ).


index(_Request) :- get_quest( Q ), reply_html_page( [ title('Dynamic HTML') ], [ h1('Questions'), p( get_all( Q ) ), Q ] ).


I know this cant work, but I cant find the right solution.







http://ift.tt/VNuVSS