Can someone tell me why this doesn't sort:
Code:
<xsl:apply-templates select="$structure//item" mode="edit-news-item-index">
<xsl:sort select="@*[name() = $sort]" order="ascending" />
</xsl:apply-templates>
$sort is declared earlier in the document:
Code:
<xsl:param name="sort" select="'@type'" />
Its value is changed dynamically (using ASP), depending on which attribute I need to sort by, and can be either: '@type' or '@live'.
I don't think the problem has anything to to with the XML data but, just in case, here is a sample:
Code:
<item type="article" status="display" live="20050707" home="20050707">
<headline>London Terror Attack</headline>
<meta />
<content src="ITE20050707001"/>
</item>
<item type="article" status="display" live="20050707" home="20050707">
<headline>Temporary Closure</headline>
<meta />
<flash date="200500707" expires="20050712"><p>The school will be closed on Friday 8th July.</p></flash>
<content src="ITE20050707002"/>
</item>
<item type="article" status="display" live="20050707" href="http://news.bbc.co.uk/1/hi/education/4659861.stm">
<headline>Schools Closed Following Blasts</headline>
<meta />
<content src="ITE20050707003"/>
</item>
This has really got me stumped. Please let me know if you need more information to be able to help.