<?xmlversion="1.0"?> <Order> <Account>9900234</Account> <Itemid="1"> <SKU>1234</SKU> <PricePer>5.95</PricePer> <Quantity>100</Quantity> <Subtotal>595.00</Subtotal> <Description>SuperWidgetClamp</Description> </Item> <Itemid="2"> <SKU>6234</SKU> <PricePer>22.00</PricePer> <Quantity>10</Quantity> <Subtotal>220.00</Subtotal> <Description>MightyFoobarFlange</Description> </Item> <Itemid="3"> <SKU>9982</SKU> <PricePer>2.50</PricePer> <Quantity>1000</Quantity> <Subtotal>2500.00</Subtotal> <Description>DeluxeDoohickie</Description> </Item> <Itemid="4"> <SKU>3256</SKU> <PricePer>389.00</PricePer> <Quantity>1</Quantity> <Subtotal>389.00</Subtotal> <Description>MuckalucketBucket</Description> </Item> <NumberItems>1111</NumberItems> <Total>3704.00</Total> <OrderDate>07/07/2002</OrderDate> <OrderNumber>8876</OrderNumber> </Order> ListingB:order.xsl <?xmlversion="1.0"?> <xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:paramname="column"select="’SKU’"/> <xsl:paramname="order"select="’ascending’"/> <xsl:templatematch="/"> <html> <body> <xsl:apply-templatesselect="Order"> <xsl:with-paramname="sortcolumn"select="$column"/> <xsl:with-paramname="sortorder"select="$order"/> </xsl:apply-templates> </body> </html> </xsl:template> <xsl:templatematch="Order"> <xsl:paramname="sortcolumn"/> <xsl:paramname="sortorder"/> <tableborder="1"> <tr> <th>Account</th> <th>SKU</th> <th>Description</th> <th>Price</th> <th>Quantity</th> <th>Subtotal</th> </tr> <xsl:apply-templatesselect="Item"> <xsl:sortselect="*[name()=$sortcolumn]"order="{$sortorder}"/> </xsl:apply-templates> </table> </xsl:template> <xsl:templatematch="Item"> <tr> <td><xsl:value-ofselect="../Account"/></td> <td><xsl:value-ofselect="SKU"/></td> <td><xsl:value-ofselect="Description"/></td> <td><xsl:value-ofselect="PricePer"/></td> <td><xsl:value-ofselect="Quantity"/></td> <td><xsl:value-ofselect="Subtotal"/></td> </tr> </xsl:template> </xsl:stylesheet> |