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

xsl:element generiert Element in der Reihenfolge der Verarbeitung. XSLT Stylesheet 1 benutzt diese Eigenschaft, w?hrend XSLT Stylesheet 2 erzeugt den selben Effekt, auf eine etwas kompliziertere Art und Weise. XSLT Stylesheet 1 XSLT Stylesheet 2

XSLT Stylesheet 1

XML Quelltext
<source>

<text size="H1">Header1</text>
<text size="H3">Header3</text>
<text size="b">Bold text</text>
<text size="sub">Subscript</text>
<text size="sup">Superscript</text>

</source>

Ausgabe
<H1>Header1</H1>
<H3>Header3</H3>
<b>Bold text</b>
<sub>Subscript</sub>
<sup>Superscript</sup>

HTML-Ansicht

Header1

Header3

Bold text Subscript Superscript
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <xsl:for-each select="//text">
          <xsl:element name="{@size}">
               <xsl:value-of select="."/>
          </xsl:element>
     </xsl:for-each>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 2

XML Quelltext
<source>

<text size="H1">Header1</text>
<text size="H3">Header3</text>
<text size="b">Bold text</text>
<text size="sub">Subscript</text>
<text size="sup">Superscript</text>

</source>

Ausgabe
<H1>Header1</H1>
<H3>Header3</H3>
<b>Bold text</b>
<sub>Subscript</sub>
<sup>Superscript</sup>

HTML-Ansicht

Header1

Header3

Bold text Subscript Superscript
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <xsl:for-each select="//text">
          <xsl:choose>
               <xsl:when test='@size="H1"'>
                    <H1>
                         <xsl:value-of select="."/>
                    </H1>
               </xsl:when>
               <xsl:when test='@size="H3"'>
                    <H3>
                         <xsl:value-of select="."/>
                    </H3>
               </xsl:when>
               <xsl:when test='@size="b"'>
                    <b>
                         <xsl:value-of select="."/>
                    </b>
               </xsl:when>
               <xsl:when test='@size="sub"'>
                    <sub>
                         <xsl:value-of select="."/>
                    </sub>
               </xsl:when>
               <xsl:when test='@size="sup"'>
                    <sup>
                         <xsl:value-of select="."/>
                    </sup>
               </xsl:when>
          </xsl:choose>
     </xsl:for-each>
</xsl:template>


</xsl:stylesheet>


Kevin Carr in Stanton

Natural Skin Care and European Soaps
TickTalk 5
city of stanton
internetusers

City Of Stanton | City Of Stanton | Warren Stanton Council and Gary Taylor Stanton | City Of Stanton |



Take a moment to visit 1cecilia438 or see them on twitter at 1cecilia410 or view them on facebook at hawaiian luxury shoes.

Take a moment to visit 1cecilia448 or see them on twitter at 1cecilia448 or view them on facebook at 1cecilia448.

Don't forget to check out the following links. You'll be glad you did:

You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks