Nic Miloslav     Example 66    KEYWORDS      EXAMPLES      AUTHORS     

Results of stylesheet combining depends on the position of xsl:include or xsl:import.


     XML     HOME     XSL 1     XSL 2     XSL 3     XSL 4     XSL 5      
<xslTutorial >
<AAA/>
<BBB/>
<CCC/>
</xslTutorial>

     XSL 1     HOME     XML     HTML 1     OUTPUT 1     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/*/*">
<DIV style="color:red">
<xsl:value-of select="name()"/>
<xsl:text> (according to Stylesheet 1 (id2.xsl)</xsl:text>
</DIV>
</xsl:template>
</xsl:stylesheet>

     HTML 1     HOME     XML     XSL 1     OUTPUT 1     
<DIV style="color:red">AAA (according to Stylesheet 1 (id2.xsl)</DIV>
<DIV style="color:red">BBB (according to Stylesheet 1 (id2.xsl)</DIV>
<DIV style="color:red">CCC (according to Stylesheet 1 (id2.xsl)</DIV>

     OUTPUT 1     HOME     XML     XSL 1     HTML 1     
AAA (according to Stylesheet 1 (id2.xsl)
BBB (according to Stylesheet 1 (id2.xsl)
CCC (according to Stylesheet 1 (id2.xsl)

     XSL 2     HOME     XML     HTML 2     OUTPUT 2     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:include href="id2.xsl"/>
<xsl:template match="/">
<xsl:apply-templates/ >
</xsl:template>
<xsl:template match="/*/*">
<DIV style="color:blue">
<xsl:value-of select="name()"/>
<xsl:text> (according to this stylesheet)</xsl:text>
</DIV>
</xsl:template>
</xsl:stylesheet>

     HTML 2     HOME     XML     XSL 2     OUTPUT 2     
<DIV style="color:blue">AAA(according to this stylesheet)</DIV>
<DIV style="color:blue">BBB(according to this stylesheet)</DIV>
<DIV style="color:blue">CCC(according to this stylesheet)</DIV>

     OUTPUT 2     HOME     XML     XSL 2     HTML 2     
AAA(according to this stylesheet)
BBB(according to this stylesheet)
CCC(according to this stylesheet)

     XSL 3     HOME     XML     HTML 3     OUTPUT 3     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:import href="id2.xsl"/>
<xsl:template match="/">
<xsl:apply-templates/ >
</xsl:template>
<xsl:template match="/*/*">
<DIV style="color:blue">
<xsl:value-of select="name()"/>
<xsl:text> (according to this stylesheet)</xsl:text>
</DIV>
</xsl:template>
</xsl:stylesheet>

     HTML 3     HOME     XML     XSL 3     OUTPUT 3     
<DIV style="color:blue">AAA(according to this stylesheet)</DIV>
<DIV style="color:blue">BBB(according to this stylesheet)</DIV>
<DIV style="color:blue">CCC(according to this stylesheet)</DIV>

     OUTPUT 3     HOME     XML     XSL 3     HTML 3     
AAA(according to this stylesheet)
BBB(according to this stylesheet)
CCC(according to this stylesheet)

     XSL 4     HOME     XML     HTML 4     OUTPUT 4     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<xsl:apply-templates/ >
</xsl:template>
<xsl:template match="/*/*">
<DIV style="color:blue">
<xsl:value-of select="name()"/>
<xsl:text> (according to this stylesheet)</xsl:text>
</DIV>
</xsl:template>
<xsl:include href="id2.xsl"/>
</xsl:stylesheet>

     HTML 4     HOME     XML     XSL 4     OUTPUT 4     
<DIV style="color:red">AAA (according to Stylesheet 1 (id2.xsl)</DIV>
<DIV style="color:red">BBB (according to Stylesheet 1 (id2.xsl)</DIV>
<DIV style="color:red">CCC (according to Stylesheet 1 (id2.xsl)</DIV>

     OUTPUT 4     HOME     XML     XSL 4     HTML 4     
AAA (according to Stylesheet 1 (id2.xsl)
BBB (according to Stylesheet 1 (id2.xsl)
CCC (according to Stylesheet 1 (id2.xsl)

     XSL 5     HOME     XML     HTML 5     OUTPUT 5     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<xsl:apply-templates/ >
</xsl:template>
<xsl:template match="/*/*">
<DIV style="color:blue">
<xsl:value-of select="name()"/>
<xsl:text> (according to this stylesheet)</xsl:text>
</DIV>
</xsl:template>
<xsl:import href="id2.xsl"/>
</xsl:stylesheet>

     HTML 5     HOME     XML     XSL 5     OUTPUT 5     
<DIV style="color:red">AAA (according to Stylesheet 1 (id2.xsl)</DIV>
<DIV style="color:red">BBB (according to Stylesheet 1 (id2.xsl)</DIV>
<DIV style="color:red">CCC (according to Stylesheet 1 (id2.xsl)</DIV>

     OUTPUT 5     HOME     XML     XSL 5     HTML 5     
AAA (according to Stylesheet 1 (id2.xsl)
BBB (according to Stylesheet 1 (id2.xsl)
CCC (according to Stylesheet 1 (id2.xsl)