Sort XML Data from a Dropdownlist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cassim
    New Member
    • Feb 2020
    • 1

    Sort XML Data from a Dropdownlist

    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="bookaut hor"/> will only do one element.
    Can "select = " be a variable based on the selection of the dropdown list

    Code:
    <book> 
    <booktitle> Book 1</booktitle>
    <bookauthor> A</bookauthor> 
    <booknumber> 123 </booknumber> 
    </book> 
    
    <book> 
    <booktitle> Book 2</booktitle> 
    <bookauthor>B</bookauthor> 
    <booknumber> 786</booknumber> 
    </book> 
    
    <book> 
    <booktitle> Book 3</booktitle> 
    <bookauthor> C</bookauthor> 
    <booknumber> 456 </booknumber> 
    </book>
    Appreciate any assistance.
    thank you.
    Last edited by gits; Feb 18 '20, 11:44 AM. Reason: added code tags
Working...