I am having some trouble using the order-by clause to sort output by
attributes. For example, given the following xml:

<schema name="TestSchema" xmlns="urn:schemas-microsoft-com:xml-data"
<elementtype name="items">
<elementtype name="item">
<attributetype name="order" dt:type="int" />
<item order="1" />
<item order="3" />
<item order="10" />
<item order="5" />
<item order="20" />

I then apply the following xsl to do a transformation:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="xml/items/item" order-by="@order">
Item #<xsl:value-of select="@order" /><br />

I expect to get the following list

Item #1
Item #3
Item #5
Item #10
Item #20

But instead, get this list

Item #1
Item #10
Item #20
Item #3
Item #5

If I change the order-by clause to order-by="number(@order)", the items are
correctly sorted in the output. So it seems that the schema definition for
the @order attribute is not being properly recognized. Am I missing
something simple?