Melanie asked about getting rid of extraneous spaces following instances of names in references, for example in HENS2.xml:
<ref type="internal" target="render_page.php?id=HENS2&n=12"><name type="person" key="ALLE2">Edward Alleyn</name></ref>
After much struggle by me and Martin looking through the XSLT, the php XQuery we eventually concluded that the problem must be a bug in the php or libxsl library. We were able to solve the problem by adding
<xsl:strip-space elements="tei:ref"/>
to render_page.xsl