Talk:NotesToRefs.xsl

For obscure reasons I was poking around this stylesheet, trying to figure out what it did. In doing so I started to re-write it a bit in my head, and then thought “why not re-write it for real?”.

I think the following performs the same task. I also think it is easier to follow, and is more “XSLT-like” (i.e., declarative) in its structure, although others may disagree.

 



        

    <xsl:call-template name="make-note-div"/> </xsl:if> </xsl:copy> </xsl:template>

  <xsl:apply-templates select="@*|node"/> <xsl:call-template name="make-note-div"/> </xsl:copy> </xsl:template>

 <head xml:lang="la">Notae <xsl:apply-templates select="//tei:note" mode="moveback"/> </xsl:template>

 </xsl:template>

 <note place="foot" target="{concat('r',generate-id(.))}"> <xsl:attribute name="xml:id"> <xsl:value-of select="concat('n',generate-id(.))"/> </xsl:attribute> <xsl:copy-of select="@*[not(attribute::xml:id or attribute::target or attribute::place)]"/> <xsl:apply-templates select="node"/> <xsl:text>&#x0A;</xsl:text> </xsl:template>

</xsl:stylesheet>