[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] dynamic sort order
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. XML: <supplementaryData> <sort> <sortField>employer</sortField> <sortField>lastName</sortField> <sortPage>search.cfm</sortPage> </sort> <display> <displayField>name</displayField> <displayField>code</displayField> <displayField>employer</displayField> <displayField>room</displayField> <displayField>phone</displayField> <displayField>email</displayField> </display> </supplementaryData> XSLT: <xsl:apply-templates select="searchResult"> <!-- set the sort --> <!-- cannot do this here!!! How to do it?? <xsl:call-template name="sort" /> --> </xsl:apply-templates> <!-- sort --> <xsl:template name="sort"> <xsl:for-each select="/searchResults/supplementaryData/sort/sortField"> <xsl:sort select="normalize-space(.)"/> </xsl:for-each> </xsl:template> Any ideas on how I can get around this hiccup? --Nate __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com 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
|