English | >> Français << | Deutsch | Magyar | 中文 | Polski adultinternetusers > Tutorials > XSLT Tutorial
>> Page 19 << | Précédent | Suivant | Contenu | Index des éléments

Les noeuds sélectionnés avec l'élément xsl:for-each ( Feuille de style XSLT 1 et Feuille de style XSLT 2 ) ou xsl:apply-templates ( Feuille de style XSLT 3 ) peuvent être triés. L'ordre de tri détermine l'ordre des attributs. Feuille de style XSLT 1 effectue un tri croissant, tandis que Feuille de style XSLT 2 effectue un tri décroissant.

Feuille de style XSLT 1

Source Surf
<source>

<name>John</name>
<name>Josua</name>
<name>Charles</name>
<name>Alice</name>
<name>Martha</name>
<name>George</name>

</source>

Sortie
<TABLE>
  <TR>
     <TH>Alice</TH>
  </TR>
  <TR>
     <TH>Charles</TH>
  </TR>
  <TR>
     <TH>George</TH>
  </TR>
  <TR>
     <TH>John</TH>
  </TR>
  <TR>
     <TH>Josua</TH>
  </TR>
  <TR>
     <TH>Martha</TH>
  </TR>
</TABLE>

Vue HTML
Alice
Charles
George
John
Josua
Martha
Feuille de style XSLT
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//name">
               <xsl:sort order="ascending" select="."/>
               <TR>
                    <TH>
                         <xsl:value-of select="."/>
                    </TH>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



Feuille de style XSLT 2

Source Surf
<source>

<name>John</name>
<name>Josua</name>
<name>Charles</name>
<name>Alice</name>
<name>Martha</name>
<name>George</name>

</source>

Sortie
<TABLE>
  <TR>
     <TH>Martha</TH>
  </TR>
  <TR>
     <TH>Josua</TH>
  </TR>
  <TR>
     <TH>John</TH>
  </TR>
  <TR>
     <TH>George</TH>
  </TR>
  <TR>
     <TH>Charles</TH>
  </TR>
  <TR>
     <TH>Alice</TH>
  </TR>
</TABLE>

Vue HTML
Martha
Josua
John
George
Charles
Alice
Feuille de style XSLT
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:for-each select="//name">
               <xsl:sort order="descending" select="."/>
               <TR>
                    <TH>
                         <xsl:value-of select="."/>
                    </TH>
               </TR>
          </xsl:for-each>
     </TABLE>
</xsl:template>


</xsl:stylesheet>



Feuille de style XSLT 3

Source Surf
<source>

<name>John</name>
<name>Josua</name>
<name>Charles</name>
<name>Alice</name>
<name>Martha</name>
<name>George</name>

</source>

Sortie
<TABLE>
  <TR>
     <TH>Martha</TH>
  </TR>
  <TR>
     <TH>Josua</TH>
  </TR>
  <TR>
     <TH>John</TH>
  </TR>
  <TR>
     <TH>George</TH>
  </TR>
  <TR>
     <TH>Charles</TH>
  </TR>
  <TR>
     <TH>Alice</TH>
  </TR>
</TABLE>

Vue HTML
Martha
Josua
John
George
Charles
Alice
Feuille de style XSLT
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
     <TABLE>
          <xsl:apply-templates select="//name">
               <xsl:sort order="descending" select="."/>
          </xsl:apply-templates>
     </TABLE>
</xsl:template>

<xsl:template match="name">
     <TR>
          <TH>
               <xsl:value-of select="."/>
          </TH>
     </TR>
</xsl:template>


</xsl:stylesheet>


Kevin Carr in Stanton

Natural Skin Care and 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