home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <!-- ===========================================================
- Category: XMLtoXML
- Author: David Silverlight
- HeadGeek@xmlpitstop.com
- Created: 2001-05-16
- Description:-
- This stylsheet will create an output of attributes from a
- set of sorted elements. Each element generated will contain
- only specific attributes for customers sorted by countryname.
- ================================================================ -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/>
-
- <xsl:template match="/">
- <customers>
- <xsl:apply-templates/>
- </customers>
- </xsl:template>
-
-
- <xsl:template match="customers">
- <xsl:for-each select="customer">
- <xsl:sort select="@Country" order="ascending"/>
- <customer>
- <xsl:attribute name="CompanyName" ><xsl:value-of select="@CompanyName"/></xsl:attribute>
- <xsl:attribute name="CustomerID" ><xsl:value-of select="@CustomerID"/></xsl:attribute>
- <xsl:attribute name="Country" ><xsl:value-of select="@Country"/></xsl:attribute>
- </customer>
- </xsl:for-each>
-
- </xsl:template>
-
-
- </xsl:stylesheet>