<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pf="http://www.daisy.org/ns/pipeline/functions" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" version="2.0" exclude-result-prefixes="#all"> <xsl:import href="http://www.daisy.org/pipeline/modules/file-utils/library.xsl"/> <xsl:param name="stylesheet-links" as="xs:string*" select="()"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="*[@role='doc-pagebreak']/@aria-label[matches(.,'\.\s*$')]"> <xsl:attribute name="aria-label" select="replace(.,'\.(\s*$)','$1')"/> </xsl:template> <xsl:template match="html:head"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> <xsl:variable name="base" select="base-uri(/*)"/> <xsl:for-each select="$stylesheet-links"> <link rel="stylesheet" type="text/css"> <xsl:attribute name="href" select="pf:relativize-uri(.,$base)"/> </link> </xsl:for-each> </xsl:copy> </xsl:template> </xsl:stylesheet>