[Home] [By Thread] [By Date] [Recent Entries]
Nathan Shaw wrote:
I am trying to allow an end user to specify the sort order of a result set returned from an LDAP query. I am storing their sort request inside of the XML sent into the LDAP server and plucking it off in my XSLT to sort as they desired. However, I am running into a challenge with my approach using a named template, as you cannot call a named template inside of xsl:apply-templates.
Anyway, assuming your XML is more complete as
<whatever>
<supplementaryData> ... </supplementaryData>
<searchResults>
<searchResult>
<employer>foo</employer>
...
</searchResult>
</searchResults>
</whatever>then try
<xsl:template match="whatever">
<xsl:apply-templates select="searchResults/searchResult>
<xsl:sort
select="*[name()=current()/supplementaryData/sort/sortField[1]]"/>
<xsl:sort
select="*[name()=current()/supplementaryData/sort/sortField[2]]"/>
</xsl:apply-templates>
</xsl:template>Feel free to post your problem again with more details if this doesn't match it. J.Pietschmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



