By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,470 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,470 IT Pros & Developers. It's quick & easy.

Sort XML Data from a Dropdownlist

P: 1
Hi,

I am trying to sort data from an XMLfile, but the user needs to select the sort type from a dropdown list. Is this possible?

eg in this XML file I would want a dropdown list where it can be sorted via Title, Author, Number.

<xsl:sort select="bookauthor"/> will only do one element.
Can "select = " be a variable based on the selection of the dropdown list

Expand|Select|Wrap|Line Numbers
  1. <book> 
  2. <booktitle> Book 1</booktitle>
  3. <bookauthor> A</bookauthor> 
  4. <booknumber> 123 </booknumber> 
  5. </book> 
  6.  
  7. <book> 
  8. <booktitle> Book 2</booktitle> 
  9. <bookauthor>B</bookauthor> 
  10. <booknumber> 786</booknumber> 
  11. </book> 
  12.  
  13. <book> 
  14. <booktitle> Book 3</booktitle> 
  15. <bookauthor> C</bookauthor> 
  16. <booknumber> 456 </booknumber> 
  17. </book>
Appreciate any assistance.
thank you.
Feb 18 '20 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.