I got in a good few hours of work this evening, and I really have some things to show for it.
<!-- extract the number of page images from the last graphic in the facsimile section --> <xsl:variable name="url"> <xsl:for-each select="tei:TEI/tei:facsimile/tei:surface/tei:graphic"> <xsl:if test="position()=last()"> <xsl:value-of select="@url"/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="replace-thumb" select="replace($url,'thumb','')"/> <xsl:variable name="replace-siglum" select="replace($replace-thumb,$siglum,'')"/> <xsl:variable name="replace-underscore" select="replace($replace-siglum,'_','')"/> <xsl:variable name="replace-jpg" select="replace($replace-underscore,'.jpg','')"/> <xsl:variable name="replace-slash" select="replace($replace-jpg,'/','')"/> <xsl:variable name="page-nos" select="number($replace-slash)"/>
I expect there is a more sophisticated way to do this, but I’m just tickled that I figured it out myself.
The stylesheet generates a folder, named after the siglum, and the (much simpler) stylesheet I wrote for the html file does the same, and also uses the same variables (although not as many of them).
In any case I feel really good about what I’ve been able to get through tonight, and now I am READY FOR BED.