Can someone help me interpret this xsl?
<xsl:sort select="*[name() = $dvt_sortfield] | @*[name() = $dvt_sortfield] | text()[name(ancestor::*[1]) = $dvt_sortfield]" order="{$dvt_sortdir}" data-type="{$dvt_sorttype}" />
<xsl:sort select="$dvt_sortfield" order="ascending" />
The page has a 4 column table and I believe the xml is being generated on the fly based upon a database query. Three of the columns sort correctly however one of the does not. When I click on the header, it appears to sort descending the first time, but if I click it again nothing happens. All the other columns sort between ascending/descending with each click.
Here is what I know, please let me know if I am incorrect:
The asterisk says to match any node. The | is a union character saying to include all non-duplicates. $dvt_sortfield is a parameter defined at the top of the document, <xsl:param name="dvt_sortfield">Title</xsl:param>. Order is the sort parameter ascending or descending.
I can't seem to fully understand the name function, the point of the [], or what text()[name(ancestor::*[1]) means. Any help is appreciated.