Time for action – Testing the result
You can simply execute this program and you should get the following output:
<html> <head> <title>List of Posts</title> </head> <body> <!-- Simply display a greeting --> <h1>Hi and welcome to my blog!</h1> <!-- Iterate over all Posts --> <!-- Displays the blog post's title --> <h2>First Post</h2> <!-- Displays the blog post's body --> <div>Hi, this is the first post of this blog!</div> <!-- Displays the blog post's title --> <h2>Second post</h2> <!-- Displays the blog post's body --> <div>This is the second post in a not so long series of articles.</div> <!-- Displays the blog post's title --> <h2>Third post</h2> <!-- Displays the blog post's body -->...