xsl:include pastes a module in at equal precedence; xsl:import gives its rules lower import precedence, so the importing stylesheet overrides them regardless of priority, and xsl:apply-imports calls the overridden rule. A brand layer over a shared base:
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
expand-text="yes">
<xsl:output method="text"/>
<xsl:template match="/catalog">
<xsl:apply-templates select="book[position() le 2]"/>
</xsl:template>
<xsl:template match="book">{title} ({subject}) </xsl:template>
<xsl:template match="book[pages > 400]" priority="9">Long: {title} </xsl:template>
</xsl:stylesheet><xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="base.xsl"/>
<xsl:template match="book">* <xsl:apply-imports/></xsl:template>
</xsl:stylesheet>Running base.xsl, then brand.xsl, on the catalog:
The Quiet Harbor (Fiction) Long: Patterns of the Deep Web * The Quiet Harbor (Fiction) * Long: Patterns of the Deep Web
Base's priority="9" rule lost to brand's plain book rule (precedence first, priority second), but inside xsl:apply-imports it competed normally, so b2 still got "Long".