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

Addition, Subtraktion und Multiplikation verwenden die bekannte Syntax ( XSLT Stylesheet 1 ). Division ist etwas ungew?hnlich. Der Slash / wird bereits in Paterns verwendendet. Stattdessen wird das Schlüsselwort div verwendet ( XSLT Stylesheet 2 ).Der Operator mod liefert den Rest nach einer Teiler-Division. ( XSLT Stylesheet 2 )

XSLT Stylesheet 1

XML Quelltext
<source>

<number>1</number>
<number>3</number>
<number>4</number>
<number>17</number>
<number>8</number>
<number>11</number>

</source>

Ausgabe
<P>1 + 3 = 4</P>
<P>4 - 17 = -13</P>
<P>8 * 11 = 88</P>

HTML-Ansicht

1 + 3 = 4

4 - 17 = -13

8 * 11 = 88

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

<xsl:template match="/">
     <P>
          <xsl:value-of select="//number[1]"/>
          <xsl:text> + </xsl:text>
          <xsl:value-of select="//number[2]"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="//number[1] + //number[2]"/>
     </P>
     <P>
          <xsl:value-of select="//number[3]"/>
          <xsl:text> - </xsl:text>
          <xsl:value-of select="//number[4]"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="//number[3] - //number[4]"/>
     </P>
     <P>
          <xsl:value-of select="//number[5]"/>
          <xsl:text> * </xsl:text>
          <xsl:value-of select="//number[6]"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="//number[5] * //number[6]"/>
     </P>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 2

XML Quelltext
<source>

<number>1</number>
<number>3</number>
<number>4</number>
<number>17</number>
<number>8</number>
<number>11</number>

</source>

Ausgabe
<P>8 / 11 = 0.7272727272727273</P>
<P>8 mod 11 = 8</P>

HTML-Ansicht

8 / 11 = 0.7272727272727273

8 mod 11 = 8

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

<xsl:template match="/">
     <P>
          <xsl:value-of select="//number[5]"/>
          <xsl:text> / </xsl:text>
          <xsl:value-of select="//number[6]"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="//number[5] div //number[6]"/>
     </P>
     <P>
          <xsl:value-of select="//number[5]"/>
          <xsl:text> mod </xsl:text>
          <xsl:value-of select="//number[6]"/>
          <xsl:text> = </xsl:text>
          <xsl:value-of select="//number[5] mod //number[6]"/>
     </P>
</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