以下のXML入力:
<Global>
<ProductFood>
<foodName>Burger</foodName>
<foodName>Snack</foodName>
</ProductFood>
<ProductToy>
<Product ProductID="1">
<productName>Doll</productName>
<Color>Green</Color>
</Product>
<Product ProductID="2">
<productName>Ball</productName>
<Color>White</Color>
</Product>
</ProductToy>
</Global>
私が持っているXSLTコードは以下のとおりです。
<xsl:template match="//Products">
<html>
<body>
<Products>
<xsl:apply-templates select="ProductToy" >
<xsl:sort select="@name"/>
<xsl:apply-templates/>
</Products>
</body>
</html>
</xsl:template>
<xsl:template match="Product">
<xsl:element name="product">
<xsl:attribute name="name" select="ProductName/text()" />
<xsl:element name="productID">
<xsl:value-of select="@ProductID" />
</xsl:element>
</xsl:element>
</xsl:template>
出力に昇順で商品属性名を返したいのですが、最初に商品ボールが表示され、次に人形のみが表示されるため、並べ替えが機能しません。機能させる方法を教えてください。