|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: dynamic sort order
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








