#!/usr/bin/perl

use 5.008;
use DateTime;

print <<'INTRO';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"><html
  xmlns="http://www.w3.org/1999/xhtml" version="RDFa 1.1">
  <head about="">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>DataRSS Initial Context</title>
    <link type="text/css" rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/base.css">
    <style type="text/css">
      td:first-child + td a { color:darkGreen}
      td:first-child + td { color:darkGreen}
      td {
          border: inset 1pt;
          margin-bottom: 10ex;
      }
      th { 
          text-align: center; 
          font-weight: bold;
          background: lavender
      }
      tr:nth-child(even) { background: lavender}
      caption { font-weight: bold}
    </style>
  </head>
  <body about="" prefix="
        rdfa: http://www.w3.org/ns/rdfa#    rdfs: http://www.w3.org/2000/01/rdf-schema#
        dcterms: http://purl.org/dc/terms/   foaf: http://xmlns.com/foaf/0.1/">
    <div class="head">
      <!-- <p><a href="http://www.w3.org/"> <img alt="W3C" src="http://www.w3.org/Icons/w3c_home"
            height="48" width="72"> </a> </p> -->
      <h1 property="dcterms:title">DataRSS Initial Context</h1>
    </div>
    <h2>Vocabulary Prefixes</h2>
    <table>
      <caption>Vocabulary Prefixes defined for DataRSS</caption>
      <thead>
        <tr>
          <th>Prefix</th>
          <th>URI</th>
        </tr>
      </thead>
      <tbody>
INTRO

while (<DATA>)
{
	my ($prefix, $uri);
	chomp;
	die "huh? $_" unless ($prefix, $uri) = /^(\S+):\s+(\S+)$/;
	
	printf("        <tr typeof=\"rdfa:PrefixMapping\">\n");
	printf("          <td property=\"rdfa:prefix\">%s</td>\n", $prefix);
	printf("          <td property=\"rdfa:uri\">%s</td>\n", $uri);
	printf("        </tr>\n");
}

printf(<<'INTRO', DateTime->now->strftime('%Y-%m-%d'), DateTime->now->strftime('%Y/%m/%d %T'));

      </tbody>
    </table>
    <hr>
    <address><span rel="dcterms:creator"><span about="http://tobyinkster.co.uk/#i"
          typeof="foaf:Person"><span property="foaf:name" datatype=""><a href="http://tobyinkster.co.uk/"
          >Toby Inkster</a></span>, <a rel="foaf:mbox" href="mailto:mail@tobyinkster.co.uk">mail@tobyinkster.co.uk</a>,
            </span> </span> <span property="dcterms:date">%s</span>
      <br>
      <span>$Date: %s $</span> </address>
  </body>
</html>

INTRO

__DATA__
abmeta: http://www.abmeta.org/ns#
action: http://search.yahoo.com/searchmonkey/action/
assert: http://search.yahoo.com/searchmonkey/assert/
cc:     http://creativecommons.org/ns#
commerce:       http://search.yahoo.com/searchmonkey/commerce/
context:        http://search.yahoo.com/searchmonkey/context/
country:        http://search.yahoo.com/searchmonkey-datatype/country/
currency:       http://search.yahoo.com/searchmonkey-datatype/currency/
dbpedia:        http://dbpedia.org/resource/
dc:     http://purl.org/dc/terms/
fb:     http://rdf.freebase.com/
feed:   http://search.yahoo.com/searchmonkey/feed/
finance:        http://search.yahoo.com/searchmonkey/finance/
foaf:   http://xmlns.com/foaf/0.1/
geo:    http://www.georss.org/georss#
gr:     http://purl.org/goodrelations/v1#
job:    http://search.yahoo.com/searchmonkey/job/
media:  http://search.yahoo.com/searchmonkey/media/
news:   http://search.yahoo.com/searchmonkey/news/
owl:    http://www.w3.org/2002/07/owl#
page:   http://search.yahoo.com/searchmonkey/page/
product:        http://search.yahoo.com/searchmonkey/product/
rdf:    http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs:   http://www.w3.org/2000/01/rdf-schema#
reference:      http://search.yahoo.com/searchmonkey/reference/
rel:    http://search.yahoo.com/searchmonkey-relation/
resume: http://search.yahoo.com/searchmonkey/resume/
review: http://purl.org/stuff/rev#
sioc:   http://rdfs.org/sioc/ns#
social: http://search.yahoo.com/searchmonkey/social/
stag:   http://semantictagging.org/ns#
tagspace:       http://search.yahoo.com/searchmonkey/tagspace/
umbel:  http://umbel.org/umbel/sc/
use:    http://search.yahoo.com/searchmonkey-datatype/use/
vcal:   http://www.w3.org/2002/12/cal/icaltzd#
vcard:  http://www.w3.org/2006/vcard/ns#
xfn:    http://gmpg.org/xfn/11#
xhtml:  http://www.w3.org/1999/xhtml/vocab#
xsd:    http://www.w3.org/2001/XMLSchema#
