Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
count tags
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<xsl:for-each select="descendant::*:fsDecl">
<xsl:variable name="id" select="@xml:id"/>
<xsl:value-of select="*:fsDescr"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="count(ancestor::*:TEI/descendant::*:fs[@type=$id])"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment