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

Knoten, die mit xsl:for-each ( XSLT Stylesheet 1 und XSLT Stylesheet 2 )oder xsl:apply-templates ( XSLT Stylesheet 3 ) selektiert werden, k?nnen sortiert werden. Wenn eine Sortierreihenfolge berücksichtigt werden soll, ist das Order Attribute notwendig. XSLT Stylesheet 1 sortiert in ausfteigender und XSLT Stylesheet 2 sortiert in absteigender Reihenfolge.

XSLT Stylesheet 1

XML Quelltext
<source>

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

</source>

Ausgabe
<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>

HTML-Ansicht
Alice
Charles
George
John
Josua
Martha
XSLT Stylesheet
<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>



XSLT Stylesheet 2

XML Quelltext
<source>

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

</source>

Ausgabe
<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>

HTML-Ansicht
Martha
Josua
John
George
Charles
Alice
XSLT Stylesheet
<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>



XSLT Stylesheet 3

XML Quelltext
<source>

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

</source>

Ausgabe
<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>

HTML-Ansicht
Martha
Josua
John
George
Charles
Alice
XSLT Stylesheet
<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