English | Français | >> Deutsch << | Magyar | 中文 | Polski ZVON > Tutorials > XSLT Tutorial
>> Seite 68 << | Zurück | Vor | Inhalt | Element-Index

XSLT Stylesheet 3 importiert XSLT Stylesheet 2 , und XSLT Stylesheet 2 importiert XSLT Stylesheet 1 .

XSLT Stylesheet 1

XML Quelltext
<source>

<AAA>red</AAA>
<BBB>blue</BBB>
<CCC>purple</CCC>

</source>

Ausgabe
<h3 style="color:red">red</h3>
blue
purple

HTML-Ansicht

red

blue purple
XSLT Stylesheet (file: id2.xsl )
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="AAA">
     <h3 style="color:{.}">
          <xsl:value-of select="."/>
     </h3>
</xsl:template>


</xsl:stylesheet>


XSLT Stylesheet 2

XML Quelltext
<source>

<AAA>red</AAA>
<BBB>blue</BBB>
<CCC>purple</CCC>

</source>

Ausgabe
<h3 style="color:red">red</h3>

<h2 style="color:blue">blue</h2>
purple

HTML-Ansicht

red

blue

purple
XSLT Stylesheet (file: id3.xsl )
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:import href="id2.xsl"/>
<xsl:template match="BBB">
     <h2 style="color:{.}">
          <xsl:value-of select="."/>
     </h2>
</xsl:template>


</xsl:stylesheet>


XSLT Stylesheet 3

XML Quelltext
<source>

<AAA>red</AAA>
<BBB>blue</BBB>
<CCC>purple</CCC>

</source>

Ausgabe
<h3 style="color:red">red</h3>

<h2 style="color:blue">blue</h2>

<h1 style="color:purple">purple</h1>

HTML-Ansicht

red

blue

purple

XSLT Stylesheet (file: id4.xsl )
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:include href="id3.xsl"/>
<xsl:template match="CCC">
     <h1 style="color:{.}">
          <xsl:value-of select="."/>
     </h1>
</xsl:template>


</xsl:stylesheet>