+ <xsl:choose>
+ <xsl:when test='$idnode/@src and not(parent::*)'>
+ <!-- remove .svg suffix -->
+ <xsl:variable name='raw'
+ select='substring($idnode/@src, 1, string-length($idnode/@src)-4)' />
+
+ <xsl:attribute name='class'>
+ <xsl:value-of select='normalize-space(concat(@class, " embed ",
+ translate($raw, "/", " ")))' />
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode='embed-svg' select='@class' />
+ </xsl:otherwise>
+ </xsl:if>
+ <xsl:apply-templates mode='embed-svg'
+ select='@*[local-name()!="id" and local-name()!="class"]' />