Pattern: Overloaded Templates
-
Bekannte Verwendung
- Cocoon 2(a5) verwendet im Core Stylesheet für das Erstellen der
Sitemap das Pattern. Der Javacode für Actions wird je nach dem, ob
ein Actionset verwendet wird von einem unterschiedlichen Template
erzeugt.
<!--processing of an act element having a type
attribute-->
<xsl:template match="map:act[@type]">
...
</xsl:template> <!-- match="map:act[@type]"
-->
<!--processing of an act element having a set
attribute-->
<xsl:template match="map:act[@set]">
...
</xsl:template> <!-- match="map:act[@set]"
-->