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

xsl: number fügt formatierte Zahlen in die Ausgabe ein. über das Format-Attribut wird die Formatierung definiert. Das Attribut beginnt mit einer Format-Beschreibung gefolgt von entsprechenden Trennzeichen. Untersuchen sie die einzelnen Vorlagen um die unterschiedliche Schreibweise zu vergleichen.

XSLT Stylesheet 1

XML Quelltext
<source>

<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>

</source>

Ausgabe
<TABLE>
  <TR>
     <TD>1. one</TD>
  </TR>
  <TR>
     <TD>2. two</TD>
  </TR>
  <TR>
     <TD>3. three</TD>
  </TR>
  <TR>
     <TD>4. four</TD>
  </TR>
</TABLE>

HTML-Ansicht
1. one
2. two
3. three
4. four
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//n">
               <TR>
                    <TD>
                         <xsl:number value="position()" format="1. "/>
                         <xsl:value-of select="."/>
                    </TD>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 2

XML Quelltext
<source>

<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>

</source>

Ausgabe
<TABLE>
  <TR>
     <TD>001. one</TD>
  </TR>
  <TR>
     <TD>002. two</TD>
  </TR>
  <TR>
     <TD>003. three</TD>
  </TR>
  <TR>
     <TD>004. four</TD>
  </TR>
</TABLE>

HTML-Ansicht
001. one
002. two
003. three
004. four
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//n">
               <TR>
                    <TD>
                         <xsl:number value="position()" format="001. "/>
                         <xsl:value-of select="."/>
                    </TD>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 3

XML Quelltext
<source>

<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>

</source>

Ausgabe
<TABLE>
  <TR>
     <TD>A   one</TD>
  </TR>
  <TR>
     <TD>B   two</TD>
  </TR>
  <TR>
     <TD>C   three</TD>
  </TR>
  <TR>
     <TD>D   four</TD>
  </TR>
</TABLE>

HTML-Ansicht
A one
B two
C three
D four
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//n">
               <TR>
                    <TD>
                         <xsl:number value="position()" format="A "/>
                         <xsl:value-of select="."/>
                    </TD>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 4

XML Quelltext
<source>

<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>

</source>

Ausgabe
<TABLE>
  <TR>
     <TD>a# one</TD>
  </TR>
  <TR>
     <TD>b# two</TD>
  </TR>
  <TR>
     <TD>c# three</TD>
  </TR>
  <TR>
     <TD>d# four</TD>
  </TR>
</TABLE>

HTML-Ansicht
a# one
b# two
c# three
d# four
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//n">
               <TR>
                    <TD>
                         <xsl:number value="position()" format="a# "/>
                         <xsl:value-of select="."/>
                    </TD>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 5

XML Quelltext
<source>

<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>

</source>

Ausgabe
<TABLE>
  <TR>
     <TD>i: one</TD>
  </TR>
  <TR>
     <TD>ii: two</TD>
  </TR>
  <TR>
     <TD>iii: three</TD>
  </TR>
  <TR>
     <TD>iv: four</TD>
  </TR>
</TABLE>

HTML-Ansicht
i: one
ii: two
iii: three
iv: four
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//n">
               <TR>
                    <TD>
                         <xsl:number value="position()" format="i: "/>
                         <xsl:value-of select="."/>
                    </TD>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



XSLT Stylesheet 6

XML Quelltext
<source>

<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>

</source>

Ausgabe
<TABLE>
  <TR>
     <TD>I... one</TD>
  </TR>
  <TR>
     <TD>II... two</TD>
  </TR>
  <TR>
     <TD>III... three</TD>
  </TR>
  <TR>
     <TD>IV... four</TD>
  </TR>
</TABLE>

HTML-Ansicht
I... one
II... two
III... three
IV... four
XSLT Stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//n">
               <TR>
                    <TD>
                         <xsl:number value="position()" format="I... "/>
                         <xsl:value-of select="."/>
                    </TD>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>


Kevin Carr

Natural Skin Care European Soaps
TickTalk 5
city of stanton
internetusers
This is the website that has all the latest for surf, skate and snow. You can also see it here:. You'll be glad you saw the surf apparel.

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

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