How can I reorder/sort a NodeList in JavaScript?

前端 未结 3 2123
Happy的楠姐
Happy的楠姐 2021-02-14 00:27

I have what I think should be a straightforward question; let me quickly explain:

In my JavaScript, food.xml is read in with:

getMenuXml.ope         


        
3条回答
  •  旧巷少年郎
    2021-02-14 01:19

    Take a look at this: Xml, xsl Javascript sorting. Worst case scenario, you transform the data into precisely the same xml, but sorted. As long as you're paying the transformation penalty, you might consider transforming it into a form more useful for whatever the next step is.

提交回复
热议问题