Set up some more controller clauses to handle what I'm calling "info" pages; these are pages which were originally in PHP/HTML, but will now (after consultation with JJ) be in TEI XML like the rest of the data. They'll be stored in /db/data/info
. I've written a Transformer script for converting the HTML, which is working pretty well; the only things I need to think about are the addition of nested divs to enable the proper use and rendering of <head>
.
I've also written XSLT to convert these pages over to XHTML5, and spent quite a lot of time getting the page to validate. There were a couple of issues:
- The validator is unhappy with
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8" />
at the moment; don't know if that's permanent or not, but I've commented it out. - The validator required this as charset decl:
<meta charset="utf-8"/>
- It rejects this as a valid
meta/@name
:<meta name="resource-type" content="document"/>
. I've commented it out. - It gacked completely on the original code for a Facebook Share button, which is clearly invalid:
<fb:like href="" show_faces="false" width="450" action="recommend" font="arial" colorscheme="dark"></fb:like>
and also lacks an href, so I don't know what it would actually do. I replaced it with this alternative formulation which FB now offers:<div class="fb-like" data-href="mapoflondon.uvic.ca"></div>
So we now have working, valid pages being served out of the db, and also transformed inside eXist, all as part of index.xql, although every page gets its own filename ending in .htm, by doing this in the controller:
[...] (: Regular site pages served from the root with .htm filenames. :) else if (text:matches-regex($exist:path, '/[A-Za-z0-9]*.htm')) then <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> <forward url="index.xql"> <add-parameter name="subCol" value="../data/info/"/> <add-parameter name="fileId" value="{substring-before($exist:resource, '.htm')}"/> </forward> </dispatch> [...]
I'll be using similar patterns to serve other pages out of other subcollections, apparently from subfolders on the site, but all using the main index.xql file.